Errors
Partnr uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, the data was not found, etc.). Codes in the 5xx range indicate an error with Partnr's servers (these are rare).
Some 4xx errors that could be handled programmatically (e.g., a company is not found) include an error message that briefly explains the error reported.
All error responses return a JSON-encoded object with the following properties:
Property | Description | Type |
---|---|---|
error | Object containing data about the error | object |
error.code | HTTP response code | integer |
error.message | A human-friendly message describing the error | string |
This is an example of what you should expect:
Company not found error
{
"error": {
"code": 404,
"message": "Company not found."
}
}