Errors and status codes

Adaxes REST API uses conventional HTTP status codes to indicate the success or failure of a request. If a request results in an error, the response body will always contain an Error object.

The Error object has the following structure:

{
    "message": "<errorMessage>",
    "code": "<errorCode>",
    "modelState": {
        "<ModelState>"
    },
    "innerError": {
        "message": "<innerMessage>",
        "code": "<innerCode>",
        "attemptsLeft": "<attemptsLeft>"
    }
}

message string

The description of the error.


code string

A short error code that indicates the error type.


modelState ModelState

This attribute is only present if the HTTP status code is 400 Bad Request. Contains detailed information about malformed request syntax.


innerError AuthError

This attribute is only present if the HTTP status code is 403 Forbidden. Specifies why the authentication with REST API failed.

 Show attributes

innerError.message string

The description of the error reason.


innerError.code string

A short error code that indicates the authentication error type.

 Show possible values
invalidCredentials    // Login or password is incorrect.
accessDenied          // Access restricted by access control configuration.
accountIsDisabled     // User account disabled.
accountLockedOut      // User account locked out.
accountExpired        // User account expired.
logonTimeIncorrect    // User logon hours don't allow access at this time.

innerError.attemptsLeft integer

This attribute is only present if innerError.code value is invalidCredentials. Specifies how many authentication atempts the account has left before getting locked.


HTTP status codes

Each HTTP response includes a status code. Generally, the 2xx codes indicate success, 4xx indicate there is a problem with the information provided in the request, and 5xx indicate that the server was unable to process an apparently valid request.

  • Status code

  • Description

  • 200 OK

  • The request was received and processed by the Adaxes service. If the request is supposed to return an operation result in the response body, the resultType attribute of the response body will contain information about whether the requested operation was successful or not.

  • 202 Accepted

  • The request was accepted by the Adaxes service and is being processed asynchronously. For more details, see Asynchronous request execution.

  • 400 Bad request

  • One or more request parameters are invalid or missing, or the request body structure is malformed. For details, see the modelState attribute value of the response body.

  • 403 Forbidden

  • Authentication failed because the account is disabled, locked, expired, not allowed to authenticate to REST API, or the provided credentials are incorrect. This status code is also returned when the Adm-Authorization header wasn't specified for a request that requires authorization.

  • 404 Not found

  • Either it was impossible to locate the requested object based on the provided object identifier, or the requested URL is malformed.

  • 405 Method not allowed

  • The resource doesn't support the requested method or the requested operation is disabled. For details about disabling operations in REST API, see Restrict allowed operations.

  • 415 Unsupported media type

  • Either the request contains a body but no Content-Type header, or the header value is not application/json.

  • 440 Login failure

  • The security token provided in the Adm-Authorization header is either invalid or has expired.

  • 500 Internal server error

  • The Adaxes service encountered an unexpected error.

  • 503 Service unavailable

  • The Adaxes service is either unreachable or stopped.