Overview
Each API call returns an HTTP status code, result code, internal code, and response payload. When an error occurs, the response body also returns an error message.
HTTP status codes
Each API call returns an HTTP status code that reflects the result of a request:
HTTP code
|
Meaning
|
200
|
Success
|
400
|
Bad Request
|
401
|
Unauthorized
|
403
|
Forbidden
|
404
|
Not Found
|
405
|
Not Allowed
|
406
|
Not Acceptable
|
500
|
System Errors
|
Response payload
POST and GET API calls return either a JSON or XML formatted response payload. The Accept: application/<FORMAT> header in the request determines the format of the response body, where FORMAT is either json or xml.
Error message
When an error occurs, the response body contains an error message. As an example, API returns a code of 400 and the following message when an invalid asset value is specified in the call POST /accessapi/Asset/Read/{id}
{
"resultCode": "conWS_NotFound",
"asset": null,
"errorMessage": "Asset 2513511 not found.",
"internalCode": 0,
}
Result Code & Internal Code
API calls always return a result code and internal code. The list of codes can be found here (https://developer.crownpeak.com/Documentation/AccessAPI/eResultCodes/index.html).