API errors and validation responses are returned according to the Internet Engineering Task Force (IETF) Problem Details for HTTP API specification formats for HTTP APIs.
As all errors are returned with the same schema, you can use the HTTP status code and/or the type
parameter to determine what happened and act accordingly.
Problem Details Schema
Example
{"title": "Parameter(s) out of range.","type": "https://apidocs.updatedge.com/docs/errors#params-range","detail": "Querystring or Body values were submitted which did not fall into their accepted range or validation requirements.","status": 400,"errors": {"workerIds": ["You must supply at least one worker id."]}}
Basic Fields
We use the following fields from the specification:
Parameter | Description |
---|---|
Title | Short summary of the problem type. |
Type | URI reference to a description of the problem type (redirects to an anchor point on this page). |
Details | More descriptive explanation of this problem type. |
Status | HTTP status code relating to the problem type. |
Additional Fields
We add the folllowing fields to give you more information
Parameter | Description |
---|---|
Errors | A list of parameters and the respective errors which were created by the parameter data. |
Reference
Unauthorised
Causes
- Missing or mistyped api header key name
- Missing api key
- Unrecognised api key
{"title": "Unauthorised","type": "https://apidocs.updatedge.com/docs/errors#unauthorised","detail": "Request was missing the X-UE-Api-Subscription-Key header or the key supplied was invalid.","status": 401}
Invalid API Version
Causes
- Missing api-version querystring paramter.
- Incorrect api version format (e.g 1 instead of 1.0)
- Use of unsupported or non-existant api version.
- Specifying api-version multiple times.
Example
{"title": "Invalid api version","type": "https://apidocs.updatedge.com/errors#invalid-api-version","detail": "The specified API version does not exist or is not supported.","status": 401,"errors": {"api-version": ["The specified API version does not exist or is not supported."]}}
Invalid Parameters
Causes
- Submitting mistyped paramters or omitting them altogether.
- Specifying a value for a required parameter with the wrong data type (i.e. submitting a string where an integer is required).
Example
{"type": "https://apidocs.updatedge.com/docs/errors#invalid-parameters","title": "Invalid request parameter data type(s).","status": 400,"detail": "Querystring or Body parameters were omitted, mistyped or values were supplied with the wrong data type.","errors": {"start": ["The value 'end=x' is not valid."]},}
Parameters Out of Range
Causes
- Specifying a parameter value which is out of it's expected range (e.g. specifying an invalid date, or an interval that ends before it starts).
Example
{"title": "Parameter(s) out of range.","type": "https://apidocs.updatedge.com/docs/errors#parameters-out-of-range","detail": "Querystring or Body values were submitted which did not fall into their accepted range or validation requirements.","status": 400,"errors": {"daystorepeat": ["Value must be between 0 and 31 (inclusive)."]}}
Unauthorised Resource Access
Causes
- Specifying one or more resource references (e.g worker ids) to which you access was revoked (e.g. worker removes you as a contact).
- Resource does not exist.
Example
{"title": "Attempted access to unauthorised resource(s).","type": "https://apidocs.updatedge.com/docs/errors#unauthorised-resource-access","detail": "Access to some of the resources in your request were unauthorised or the resources do not exist.","status": 401,"errors": {"workerIds": ["xxxx-xxxx-xxxx-xxxx"]}}
Resource CRUD Failure
Causes
- Resource you are trying to access is in an invalid state for the operation you want to apply (e.g an offer is already complete).
- Resource already exists with the id parameter value you are using (e.g. a user account with the same email address).
Example
{"title": "Resource manipulation could not be completed.","type": "https://apidocs.updatedge.com/docs/errors#resource-crud-failure","detail": "A resource could not be created, updated or deleted due to one or more rules.","status": 500}
Internal Platform Error
Causes
- Platform unable execute the request due an internal process failure.
Example
{"title": "Internal platform error.","type": "https://apidocs.updatedge.com/docs/errors#internal-platform-error","detail": "The api encountered an internal error when executing your request on the platform.","status": 500}