The GET method of the attributes service retrieves the list of attributes, if any, defined for the user.
• | In the community edition of the server, or commercial editions without organizations, use the first form of the URL. |
• | In commercial editions with organizations, you must use the second URL to specify the user’s organization. When specifying the organization, use its unique ID, not its path. When logged in as the system admin (superuser), use the first URL to specify users of the root organization. |
Method | URL | ||
GET | http://<host>:<port>/jasperserver[-pro]/rest_v2/users/userID/attributes?<arguments> http://<host>:<port>/jasperserver[-pro]/rest_v2/organizations/orgID/users/userID/attributes? <arguments> | ||
Argument | Type | Description | |
Optional | Specify an attribute name to list the value of that specific attribute. Repeat this argument to view multiple attributes. When this argument is omitted, all attributes and their values are returned for the given user. | ||
Options | |||
accept: application/xml (default) accept: application/json | |||
Return Value on Success | Typical Return Values on Failure | ||
200 OK – The content is the list of attributes for the given user. 204 No Content – The search did not return any attributes or the user has no attributes. | 404 Not Found – When the user ID or organization ID does not match any user or organization. The content includes an error message. |
The list of attributes includes the name and value of each attribute. Each attribute may only have one value, however that value may contain a comma-separated list that is interpreted by the server as being multi-valued. The following example shows attributes in JSON format:
GET http://localhost:8080/jasperserver/rest_v2/users/joeuser/attributes
An alternative syntax exists to read a single attribute by specifying its name in the URL:
Method | URL | ||
GET | http://<host>:<port>/jasperserver[-pro]/rest_v2/users/userID/attributes/attrName http://<host>:<port>/jasperserver[-pro]/rest_v2/organizations/orgID/users/userID/attributes/attrName | ||
Options | |||
accept: application/xml (default) accept: application/json | |||
Return Value on Success | Typical Return Values on Failure | ||
200 OK – The content is a single attributes for the given user. | 404 Not Found – When the user ID or organization ID does not match any user or organization. The content includes an error message. |
The response is a single attribute name-value pair. The following example shows an attribute in JSON format:
GET http://localhost:8080/jasperserver/rest_v2/users/joeuser/attributes/Attr2
Recommended Comments
There are no comments to display.