Troubleshooting the API

A brief summary of the most common error codes and how to deal with them

While developing your solutions using Flanks API, the following error codes may be returned by several endpoints. This reference aims to provide insight about the underlying errors and its common causes.

Successful responses

200 OK

The requested operation was completed successfully.

These responses may contain a brief message indicating the operation performed and its result.

For example, when creating a credentials_token, a successful response would be:

{
"credentials_token": "<CREDENTIALS_TOKEN>",
"message": "User created successfully"
}

202 ACCEPTED

Token delayed during security checks.

When retrieving a credentials_token from a Link code, you may receive this response. This means the operation was successfully completed and Flanks is performing several security checks.

Your token will be available in about 72h.

Error responses

400 BAD REQUEST

Missing fields

The query payload is missing one or more of the required parameters or fields.

The error message will provide information about which fields are missing:

{
"error": "Missing fields: <LIST_OF_MISSING_FIELDS>",
}

Invalid parameter

A provided parameter was invalid.

The error message follows this schema:

{
"error": "Invalid <PARAMETER>",
}

Invalid parameter: an element does not exist

An element identified by a provided parameter does not exist.

For instance, while retrieving an Application by name, the error message would be similar to:

{
"error": "An application with this name does not exist",
}

401 UNAUTHORIZED

Invalid credentials

The provided authentication credentials were invalid.

The message follows this schema:

{
"error": "Invalid credentials",
}

Or:

{
"error": "Not authenticated",
}

405 METHOD NOT ALLOWED

Endpoint with invalid method

You are trying to access an endpoint with an invalid HTTP method. Check the API Docs and try again.

{
"error": "Method not allowed",
}

409 CONFLICT

An element already exists

You are trying to create an element which already exists.

For instance, when creating an Application with an already existing name, the error message would be similar to:

{
"error": "An application with this name already exists",
}

415 UNSUPPORTED MEDIA TYPE

The provided payload does not comply with the expected content type.

This error message indicates that the endpoint received data with an invalid format.

Check that the Content-Type header is set accordingly. Generally, it is application/json .

When uploading files, check that the Content-Type header is set to multipart/form-data . This error may also arise when the file content does not match the file extension; for instance, when uploading a XML file with a .pdf extension.

{
"error": "Not matching body content type",
}

500 INTERNAL SERVER ERROR

Server error

This is an internal error. The error message will provide as much information as possible to ease troubleshooting.

{
"error": "<DESCRIPTIVE_ERROR_MESSAGE>",
}