JSON response status

JSONv2 requests may return one of several response statuses.

JSON Success Response

Each JSON success response includes a record array containing the records retrieved by the given action. Each JSON object contains one or more metadata elements, prefixed with __, regarding the status for the action on each record, as illustrated in the previous examples. The JSON success responses use the following syntax:


"__status": "<value>"

where <value> is success or failure.


When the status element returns failure, the error element is added to identify the error and reason.
"__error": { "message": "<error value>", "reason": "<reason value> "}

where <error value> is the error message text and <reason value> is the reason the error was triggered.

JSON Failure Response

Each JSON failure response contains only the error and reason elements, which indicate the error message and more details about the error. Generally, this indicates that the whole JSON operation failed and no records can be processed.

For example:
{"error":"Cannot update with empty sysparm_query","reason":null}