To create an organization, put all information in an organization descriptor, and include it in a POST request to the rest_v2/organizations service, with no ID specified in the URL. The organization is created in the organization specified by the parentId value of the descriptor.
Method | URL | ||
POST | http://<host>:<port>/jasperserver-pro/rest_v2/organizations?<argument> | ||
Argument | Type | Description | |
Optional | Set this argument to false to suppress the creation of default users (joeuser, jasperadmin) in the new organization. When not specified, the default behavior is true and organizations are created with the standard default users. | ||
Content-Type | Content | ||
application/xml application/json | A partial or complete organization descriptor that includes the desired properties for the organization. | ||
Return Value on Success | Typical Return Values on Failure | ||
201 Created – The organization was successfully created using the values in the descriptor or default values if missing. | 404 Not Found – When the ID of the parent organization cannot be resolved. 400 Bad Request – When the ID or alias of the new organization is not unique on the server, or when the ID in the description contains illegal symbols. The following symbols are not allowed: id and alias: ~!+-#$%^| tenantName: |&*?<>/ |
The descriptor sent in the request should contain all the properties you want to set on the new organization. Specify the parentId value to set the parent of the organization, not the tenantUri or tenantFolderUri properties. The following example shows the descriptor in JSON format:
However, all properties have defaults or can be determined based on the alias value. The minimal descriptor necessary to create an organization is simply the alias property. In this case, the organization is created as a child of the logged-in user’s home organization. For example, if superuser posts the following descriptor, the server creates an organization with the name, ID, and alias of “HR” as a child of the root organization:
Recommended Comments
There are no comments to display.