Successful Query REST Service response
If the query was successful, the service returns an HTTP response code 200 and a JSON response that contains the list of relevant results for the query.
The envelope
The response is contained by an envelope. Thus, each response has a predictable set of keys. The next code block shows the envelope code block containing the response:
{
"response" : { ... },
"messages": {
"warns" : [],
"errors" : [],
"infos" : []
}
}
The table below describes the fields in an envelope code block:
Field name | Type | Description |
---|---|---|
messages | object | Used to communicate extra information about the response to the client. |
messages.warns | array | Warning messages (can be empty or not present). |
messages.errors | array | Error messages (can be empty or not present). |
messages.infos | array | Info messages (can be empty or not present). |
response | object | Contains the returned results. |
Sample Query REST Service response
The next code block shows a sample Query REST Service response:
{
"response": {
"totalResults": 4,
"from": 0,
"size": 10,
"hits": [
{
"id": "100-1000002267",
"extid": "1000002267",
"state": "active",
"name": "Sergey",
"firstName": "Brin",
"language": "en",
"remarks": "",
"loginId": "sergeybrin",
"title": "",
"sex": "M",
"birthdate": "1973-08-21",
"telephone": "+3619622728",
"telefax": "",
"mobile": "+301234567",
"email": "[email protected]",
"addressline1": "5th. Avenue 22.",
"addressline2": "",
"postalcode": "5432",
"city": "San Francisco",
"country": "us",
"modificationComment": "",
"isTechnicalUser": false,
"client": {
"id": "100",
"extid": "100",
"name": "Default",
"dtoType": "CLIENT",
"_internalId": "100"
},
"properties":{
"User_Import_Property2":"554434581",
"User_Import_Property1":"fine grained view test 1",
"user_global_test_1":"fineGrainedViewTest",
"User_Import_Property4":"value1",
"User_Import_Property3":"fguva"
},
"dtoType": "USER",
"_score": 0.9529938,
"_internalId": "1000002267"
},
{
"id": "100-1000002266",
"extid": "1000002266",
"state": "active",
"name": "Robert",
"firstName": "Carpenter",
"language": "en",
"remarks": "",
"loginId": "bob",
"title": "",
"sex": "M",
"birthdate": "1985-07-15",
"telephone": "+3619622728",
"telefax": "",
"mobile": "+36209622728",
"email": "[email protected]",
"addressline1": "Marker Road 53.",
"addressline2": "",
"postalcode": "1111",
"city": "Texas",
"country": "us",
"modificationComment": "",
"isTechnicalUser": false,
"client": {
"id": "100",
"extid": "100",
"name": "Default",
"dtoType": "CLIENT",
"_internalId": "100"
},
"dtoType": "USER",
"_score": 0.33225715,
"_internalId": "1000002266"
},
{
"id": "100-944004122",
"extid": "944004122",
"state": "active",
"name": "google",
"location": "Googleplex, Mountain View, California, U.S.",
"description": "",
"hname": "/944004122",
"profileless": false,
"modificationComment": "",
"parent": null,
"client": {
"id": "100",
"extid": "100",
"name": "Default",
"dtoType": "CLIENT",
"_internalId": "100"
},
"dtoType": "UNIT",
"_score": 0.162107,
"_internalId": "944004122"
},
{
"id": "230003002",
"extid": "230003002",
"name": "google_maps",
"description": "",
"url": "https://www.google.hu/maps/",
"dtoType": "APPLICATION",
"_score": 0.08306429,
"_internalId": "230003002"
},
{
"id":"250000025",
"extid":"250000025",
"name":"googleMapsAdmin",
"description":"Google Maps Administrator",
"dtoType":"ROLE",
"_score":2.094208,
"_internalId":"250000025"
}
]
},
"messages": {}
}
If the caller does not have the required rights to view the custom properties of the users, the properties
node of the User JSON
will be missing.
Special response fields
The table describes the special parameters in the query's response code block:
Field name | Type | Description |
---|---|---|
response. totalResults | number | The number of hits for the query. |
response.hits | array | An array of hits with all fields stored by the Lucene index, sorted by score, highest score first. |
dtoType | string | The type of the actual result (USER, APPLICATION, CLIENT, UNIT, ROLE). |
_score | number | The score of a hit, calculated by the Lucene search engine. It represents the relevance of a hit. The higher the score, the more relevant the hit. |
_internalId | number | The internal identifier of the result in nevisIDM. The system may remove this identifier later on without notice. Therefore, do not use this internal ID! Use the ID or extid instead. |
from | number | The starting index of the hits to return. Defaults to 0. |
size | number | The number of hits to return. Defaults to 10. |