Description
The GetUser API retrieves all attributes of a specific User. The Account Owner may call this API to get the attributes of any User, whereas a specific User may call this API to get only his own attributes.
Specific Request Parameters
(Refer to Common Request Parameters)
Name | Description | Required | Default | Possible Values |
---|---|---|---|---|
login | The username used to authenticate a user’s requests. | Yes |
|
|
apsdb.authToken | This parameter is used to sign the request with a token that was initially obtained by calling VerifyCredentails API. For more details on signing requests, please refer to the page entitled Authentication . | No | ||
apsdb.includeFieldType | To limit response size, the returned JSON responses do not include field type information for each field in a user document. Setting this paramter to true will cause each user document to have an additional attribute in the JSON response, named "_type", which lists the fields included in the user document and their corresponding field types. | No | false | true false |
Specific Response Elements
(Refer to Common Response Elements)
The following specific "result" element is a child of the common root element "response" and a sibling of the common "metadata" element:
{ "result": { "user": { "name": "user full name", "login": "user login name", "email": "user email address", "groups": [array of strings corresponding to the groups in which the user is a member], "custom field 1": "value of custom field 1" "custom field 2": "value of custom field 2" "custom field n": "value of custom field n" } } }
Specific Logical Errors
(Refer to Common Logical Error Codes)
Error | Message | Status Code |
---|---|---|
PARAMETER_REQUIRED |
| 400 |
INVALID_USER | The specified user does not exist. | 400 |
Examples
Sample Request
Request URL: http://sandbox.apstrata.com/apsdb/rest/[authenticationkey]/GetUser?apsws.time=[timestamp]&apsws.authSig=[signature]
POST parameters:
login=John
Sample XML Response
Success XML:
<response xmlns="http://www.apstrata.com/services/schemas/apstrata_database_response.xsd"> <metadata> <requestId>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</requestId> <status>success</status> </metadata> <result> <user name="John"> <attributes> <attribute name="Age"> <values> <value>32</value> </values> </attribute> <attribute name="Nationality"> <values> <value>/value> </values> </attribute> </attributes> </user> </result> </response>
Failure XML:
<response xmlns="http://www.apstrata.com/services/schemas/apstrata_database_response.xsd"> <metadata> <requestId>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</requestId> <status>failure</status> <errorCode>[errorCode]</errorCode> <errorDetail>[failMsg]</errorDetail> </metadata> </response>
Sample JSON Response
{"response": { "metadata": { "requestId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "status": "success" } "result":{ "user": { "name": "John", "Age": "32.0", "Nationality": "American" } } }}