Partial Success for Bulk Operations
Introduction
Some endpoints allow you to create or modify several entities with a single request. This type of request has a different response structure, and you must know how to read it accordingly to avoid unexpected scenarios.
HTTP Codes Status
A bulk call will always answer with the status for the main scope of the request and not for each operation. For example:
- An error in authentication, authorization, deserialization, the answer will return a code 4xx
- In any other scenario, the answer will return a code 200 regardless of the individual operations success or fail
Individual Error
Even when receiving a status code 200, it is important to check the existence and the content of the errors
array in the response. Example:
{
"data": [
{
/* confirmation for all successful operations */
},...],
"errors": [/* omitted if no error */
... /* list or operations that failed with the assigned error */
],
"warnings": [/* omitted if no error */
... /* list or operations that failed with the assigned error */
]
}
Updated over 1 year ago