Link to copy

How do I get an API access authorization token?

the Sage Active Public API V2 is secured by Oauth 2.0 authentication.

The example of obtaining a token is explained:

What rights are needed to call the API?

To have the right to call the APIs, the user must meet the following conditions:

  • The user is a Sage Active user.
  • User must be activated.

Error: Access denied due to invalid subscription key.

If this error occurs when using Sage Active Public API V2:

{
    "statusCode": 401,
    "message": "Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription."
}
Check the following points :
  • With the sample postman collection :
    Check that the subscriptionKey variable is the correct Subscription primary key or Subscription secondary key in your application.

  • With your implementation or from Postman without the example collection :
    Check in the Header of your request if x-api-key is filled in with the correct Subscription primary key or Subscription secondary key in your application.

    img

Error: JWT not present

If this error occurs when using Sage Active Public API V2

{
    "statusCode": 401,
    "message": "JWT not present."
}
Check the following points :
  • With the sample postman collection :
    Check that the accessToken variable is filled in with a valid access token.

  • With your implementation or from Postman without the example collection :
    Check in the Header of your request if Authorization is filled in with the correct Bearer [access token] retrieved from the authentication of the current user.

    img

Error:Bad request

If this error occurs when using Sage Active Public API V2

{
    "Message": "Bad Request",
    "Code": null,
    "Path": null,
    "Locations": null,
    "Extensions": null,
    "Exception": null,
    "SyntaxNode": null
}
Check the following points :
  • With the sample postman collection :
    1. Check that the X-TenantId variable is filled in.
    2. Check that the X-OrganizationId variable is filled in.
  • With your implementation or from Postman without the example collection :
    1. Check in the Header of your request if X-TenantId is filled in with a valid tenant Id.
    2. Check in the Header of your request if X-OrganizationId is filled in with a valid Organization Id.

    img img