Question
In a JSON response from Reltio, are the records returned in the same order as they appear in the request list?
Answer
Yes, in a bulk entity creation response, the records in the JSON response are ordered according to the list index from the request payload. Each object in the response includes an "index" field, which matches the order of the entities submitted in the request.
API Endpoint
POST {TenantURL}/entities
Example Request
[
{
"type": "configuration/entityTypes/Individual",
"tags": ["sport", "movies"]
},
{
"roles": [
"configuration/roles/Client",
"configuration/roles/Prospect"
],
"attributes": {
"FirstName": [
{ "value": "Ivan" }
]
}
},
{
"type": "configuration/entityTypes/Organization"
}
]
Example Response
[
{
"index": 0,
"uri": "entities/10",
"object": {
"uri": "entities/10",
"type": "configuration/entityTypes/Individual",
"tags": ["sport", "movies"]
},
"status": "OK"
},
{
"index": 1,
"uri": "entities/11",
"object": {
"uri": "entities/11",
"type": "configuration/entityTypes/Individual",
"attributes": {
"FirstName": [ { "value": "Ivan" } ]
}
},
"status": "OK"
},
{
"index": 2,
"uri": "entities/12",
"object": {
"uri": "entities/12",
"type": "configuration/entityTypes/Organization"
},
"warning": {
"code": 20001,
"message": "Created entity has no attributes"
},
"status": "OK"
}
]
The index field ensures you can correlate each response entry with the respective request object.
References
Comments
Please sign in to leave a comment.