Akkroo
  1. Support
  2. Developers
  3. API
  4. Errors

#Errors

There are two formats of error you can receive from the API:

OAuth 2 Errors

OAuth errors are used as described in OAuth 2 (RFC 6749). The response body is a JSON document in the following format:

{
	"error":<OAuth 2 error code>,
	"error_description":<Plain text description of the error>,
	"detail_error":<A more detailed error type provided by the Akkroo API>
}

OAuth 2 error codes

These are the errors used in “error”.

Error type Error description
invalid_request The request is missing a required parameter, includes an unsupported parameter value (other than grant type), repeats a parameter, includes multiple credentials, utilizes more than one mechanism for authenticating the client, or is otherwise malformed.
invalid_client Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method). The authorization server MAY return an HTTP 401 (Unauthorized) status code to indicate which HTTP authentication schemes are supported. If the client attempted to authenticate via the "Authorization" request header field, the authorization server MUST respond with an HTTP 401 (Unauthorized) status code and include the "WWW-Authenticate" response header field matching the authentication scheme used by the client.
invalid_grant The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.
unauthorized_client The authenticated client is not authorized to use this authorization grant type.
unsupported_grant_type The authorization grant type is not supported by the authorization server.

Akkroo authorisation error codes

These are the errors used in “detail_error”.

Error type Error description Can occur for
authAccessTokenNotFound The access token was not found in the request headers Endpoint authentication
authAccessTokenInvalid The access token provided was invalid Endpoint authentication
authAccessTokenExpired The access token provided has expired Endpoint authentication
authInsufficientScope The scope associated with the access token is insufficient for the request Endpoint authentication
authClientIDNotFound The client id was not found in the request for a token grant Granting token
authInvalidGrantType The grant type used was invalid Granting token
authMissingGrantType The grant type parameter is missing Granting token
authClientCredentialsInvalid The client credentials provided were invalid Granting token
authInvalidClient The client provided is invalid Granting token
authMissingClientSecret The client secret was missing from the request Granting token
authClientGrantTypeNotAllowed The grant type used is not allowed on the Akkroo API Granting token
authUnsupportedScope The scope requested is unsupported Granting token
authMissingUsername The username of the account was missing from the request body Granting token
authInvalidUser The user account specified is invalid Granting token
authMissingRefreshToken The refresh token is missing from the request Granting token
authInvalidRefreshToken The refresh token provided in the request is invalid Granting token
authRefreshTokenExpired The refresh token provided in the request has expired Granting token
authIncorrectLogin Returned when the username field is required but not provided, or the username provided is invalid. Only required if you have been granted access to more than one account. Granting token
authAccountExpired The account associated with the access token has expired Any
authAccountLocked The account you are trying to access is locked. Please contact support Any
authOther An unknown authorisation error occured. Please contact support detailing the request you were trying to make Any
authInternalServerError An internal server error has occured, please contact support Any

API errors

API errors are returned in the following format, along with an appropriate HTTP Status Code:

{
	"error":<API error code>,
	"message":<Plain text description of the error>,
	"details":<An object containing more details relevant to the specific error>
}

The generic API error codes are defined below, however individual endpoints may have additional errors.

Error type Error description Error details
bodyParse An error occured parsing the request body
validationError One or more validation errors occurred "errors" — An array of error objects. See validation errors
missingHeader A required header was missing from the request "header" — The name of the required header
invalidHeader A request header was invalid "header" — The name of the required header
invalidURL The URI requested was invalid
APIVersion The API no longer supports the version of the request or acceptable response specified
cannotRespond Cannot respond to the request, probably because an acceptable response was not specified
notFound The endpoint named in the URI does not exist
parentNotFound The parent model of the collection specified could not be found
noResults There were no results for the specified resource
noID No ID was specified for the resource
internalServerError An internal server error occurred and was logged. Please contact the Akkroo team
methodNotAllowed The specified request method is not allowed for this endpoint
methodNotImplemented The specified request method is not implemented anywhere on the API
rangeNotSatisfiable The start of the requested range was greater than the total count of data for this endpoint
preconditionFailedModifiedSince The specified client-side last modified timestamp is older than the server side timestamp. The client must update its local copy, resolve merge conflicts and resubmit
uniqueConflict There was a conflict when trying to save the resource "attribute" — the conflicting attribute
"existingID" — the ID of the existing resource
"completed — a count of the number of resources aleady saved from this request
generalAuthFail A general authorization failure occurred. Please see "message" and contact support, as this error should not normally occur.
invalidQueryParameterValue Invalid value for query parameter "parameter" — the invalid query parameter

Validation Errors

Validation errors are listed in the “errors” array in the error “details” object. A validation error has the format:

{
	"attribute":<attribute the error occured on, in dot notation format>,
	"type":<validation error type>,
	"parameters":<An object containing additional details about the error>
}

In the following example the pattern does not match the full name field. The expected pattern is returned (as a regular expression) in the parameters object.

{
	"error" : "validationError",
	"details":{
		"errors":[
			{	
				"attribute" : "values.fullName.value",
				"type" : "patternNotMatch",
				"parameters":{
					"expectedPattern" : "\/^[^\\s]+[\\s]+.*[^\\s]+$\/"
				}
			}
		]
	},
	"message" : "One or more validation errors occurred"
}

Field Validation Error Types

Error type Error description Error parameters
required The field is required
mustNotBeSet The field must not be set when saving
cannotBeUpdated The field cannot be updated
tooLong The field value is too long (e.g. an array length, string length) "length" — The current length of the field
"maxLength" — The max allowable length
tooShort The field value is too short (e.g. an array length, string length) "length" — The current length of the field
"minLength" — The minimum allowable length
tooBig The field value is to big (e.g. a number) "value" — The current value of the field
"maxVal" — The max allowable value
tooSmall The field value is to small (e.g. a number) "value" — The current value of the field
"minVal" — The max allowable value
invalidType The value provided for the field was of the wrong type "expectedTypes" — an array of the expected value types, which can be 'float' 'int' 'string' 'bool' 'array'
patternNotMatch The value provided did not match the specified pattern for this field "expectedPattern" — The regular expression which failed to match the value
invalid The value provided is otherwise invalid