Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Instructions

Overview

The goal of the document is to describe error codes for API error handling.

Scope

Description of API HTTP status codes, error codes and messages.

HTTP Status Codes

API returns appropriate HTTP status code for every request.

HTTP CodeTextDescription
200OKSuccess
400Bad RequestThe request was invalid or cannot be otherwise served
401UnauthorizedMissing or incorrect authentication credentials
403ForbiddenThe request is understood, but it has been refused or access is not allowed
404Not FoundThe requested resource does not exist
405Method not allowedThe method received in the request-line is known by the origin server but not supported by the target resource
415Unsupported Media TypeRequest header is missing content-type (e.g. application/json)
500Internal Server ErrorUnspecified server error

Error Messages

API error messages are returned in JSON format, for example:

{"errors":[{"errorCode":3001, "message":"entity not found"}]}


In certain cases (e.g. in case of field validation error) additional attributes may be present in returned JSON:

{"errors":[{"errorCode":5000, "message":"validation error", "subject":"firstName", "subjectType":"parameter"}]}

Error Codes

In addition to descriptive error message, errors contain error codes. While the text for an error message may change, the codes will stay the same. If an error response is not listed in the table or missing, fall back to examining the HTTP status codes above.


Error CodeMessageDescription
2006entity saving errorError occurred while saving the entity.
200601entity saving error: USPTA number must be uniqueError occurred while saving the entity. USPTA number must be unique.
200602entity saving error: PTR number must be uniqueError occurred while saving the entity. PTR number must be unique.
3001entity not foundEntity was not found.
3002entity already existsSame entity already exists and cannot be created.
4003authentication token is invalidAuthentication token is not valid.
4004authentication errorUnknown authentication error occurred.
4005backend system token is invalidAuthorization token for backend system call is not valid therefore request cannot be completed.
4006access deniedAccess is denied.
5000validation errorValidation error. Additional attributes "subject" and "subjectType" may be present in response containing additional information (e.g. field name).
5001illegal combination of method argumentsSupplied method arguments either invalid or incomplete.
5002entity id is emptyEntity primary key is empty, request cannot be completed.
5003unknown identifier errorUnknown entity identifier error.
5004
no remaining amount
No remaining amount error.
6001empty client orgEmpty "client org" attribute value.
6002empty passwordPassword cannot be empty.
6003invalid client grant typeInvalid "client grant type" value error.
6004invalid client profileInvalid "client profile" value error.
6005invalid client scope setInvalid "client scope" value error.
6006new password not matchNew passwords do not match.
6007wrong passwordWrong password.
9001unexpected system errorUnexpected system error.
9002HTTP message not readable errorHTTP message not readable error.
9003mail trigger errorError while triggering an email.

API Responses

Unless otherwise specified, API HTTP responses will match the following:


Success (object exists)Failure (object doesn't exist)
GET

HTTP Response Body: <<data in JSON format>>

HTTP Response Code: 200

HTTP Response Body:  

{"errorCode": 3001, "message": "entity not found"}

HTTP Response Code: 404

PUT

PATCH

HTTP Response Body: <<empty>>

HTTP Response Code: 200

HTTP Response Body:  

{"errorCode": 3001, "message": "entity not found"}

HTTP Response Code: 404


 

  • No labels