The GET method of the attributes service retrieves the list of attributes, if any, defined for the specified entity (a user, an organization, or the server-level). For possible values of <entity> in the URL, see Entities with Attributes.
There are two syntaxes; the following one is for reading multiple attributes or all attributes at once.
Method | URL | ||
GET | http://<host>:<port>/jasperserver[-pro]/rest_v2/<entity>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 entity. | ||
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 entity. 204 No Content – The search did not return any attributes or the entity 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. The following example shows user-level attributes in JSON format:
GET http://localhost:8080/jasperserver-pro/rest_v2/organizations/organzation_1/users/joeuser/attributes
The second syntax reads a single attribute by specifying its name in the URL:
Method | URL | ||
GET | http://<host>:<port>/jasperserver[-pro]/rest_v2/<entity>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 attribute for the given entity. | 404 Not Found – When the user ID, organization ID, or attribute name does not match any user, organization, or attribute. The content includes an error message. |
The response is a single attribute name-value pair. The following example shows an organization-level attribute in JSON format:
GET http://localhost:8080/jasperserver-pro/rest_v2/organizations/organization_1/attributes/Attr2
Recommended Comments
There are no comments to display.