Website

Authorization errors

Last update: 29.01.2024

Authorization errors

These errors are related to the authorization process. Below you can find the most common situations and proposed solutions.

1. Missing parameter: code is required

HTTP code: 400 Bad Request

{
  "error": "invalid_request",
  "error_description": "Missing parameter: \"code\" is required",
}

Solution:

  • provide missing code parameter in the request

Example:

{
  "grant_type":"authorization_code"
  "scope":"read write v2"
  "client_id":"<your client_id>"
  "client_secret":"<your client_secret>"
  "code":"<one time authorization token>"
}

2. Authorization code doesn't exist or is invalid for the client

HTTP code: 400 Bad Request

{
  "error": "invalid_grant",
  "error_description": "Authorization code doesn't exist or is invalid for the client",
}

Solution:

  • provide valid code parameter in the request (please remember that it is valid for 10 minutes only)

3. The grant type was not specified in the request

HTTP code: 400 Bad Request

{
  "error": "invalid_request",
  "error_description": "The grant type was not specified in the request",
}

Solution:

  • provide required grant_type parameter in the request

4. The scope requested is invalid for this client

HTTP code: 400 Bad Request

{
  "error": "invalid_scope",
  "error_description": "The scope requested is invalid for this client",
}

Solution:

  • verify provided scope
  • make sure that your API account is allowed to use a given scope

5. Client is not active

HTTP code: 401 Unauthorized

{
  "error": "invalid_client",
  "error_description": "Client is not active",
}

Solution:

  • verify client_id provided in the request

6. The client credentials are invalid

HTTP code: 400 Bad Request

{
  "error": "invalid_client",
  "error_description": "The client credentials are invalid",
}

Solution:

  • verify client_id and client_secret provided in the request

7. The access token provided is invalid

HTTP code: 401 Unauthorized

{
  "error": "invalid_token",
  "error_description": "The access token provided is invalid",
}

Solution:

  • verify access_token provided in the request

8. Insufficient scope

HTTP code: 401 Unauthorized

{
    "error": "insufficient_scope",
    "error_description": "The request requires higher privileges than provided by the access token",
    "error_human_title": "Insufficient scope."
}

Solution:

  • you need to authorize yourself with a higher privileges
  • make sure that you are authorized with a proper scopes: read write v2 instead of read write

9. Invalid owner in token

{
  "error": {
    "status": 400,
    "title": "Bad Request",
    "detail": "Invalid owner in token"
  }
}

Solution:

  • make sure that you are authenticated in the user context - "grant_type":"authorization_code" instead of "grant_type":"client_credentials"

10. The grant type is unauthorized for this client_id

{
    "error": "unauthorized_client",
    "error_description": "The grant type is unauthorized for this client_id",
    "error_human_title": "Unauthorized client."
}

Solution:

  • your API account is not allowed to use a given grant_type
  • reach out to us in order to check it out

11. Invalid refresh token

{
    "error": "invalid_grant",
    "error_description": "Invalid refresh token",
    "error_human_title": "Provided authorization credentials are invalid or expired."
}

Solution:

  • make sure that refresh_token is valid (please remember that it lasts for 2592000 seconds and can be changed when new access token is generated)
  • authenticate yourself once again in order to receive a new one