To access the Ans API V2, you'll first need to create a token. This can be done by any user with an employee role in Ans.
To create a token, follow the steps below.
- Click the following link https://ans.app/users/tokens.
- Click on Generate new token.
- A new dialog will open containing the token.
- This token is used to authorise requests through the Ans API V2 and can also be used with the beta version of the API.
The provided token is a Bearer token and needs to be set in the Request Header with key Authorization and value "Bearer [token]" for every request. The provided token can only be used with the Ans V2 API and the beta version of the API. Additional information can be found in the documentation.
Multiple API tokens can be used per account, which makes it easier to manage and rotate credentials securely. This allows a new token to be created, an integration to be updated, and the previous token to be removed without interrupting service.
Newly created tokens include an expiration period, which can be set up to a maximum of one year. In addition, tokens can optionally be restricted to a specific IP address or CIDR range, ensuring that only requests from allowed locations are accepted.
Existing tokens remain valid without an expiration date and cannot be updated with one. If an expiration date is required, a new token should be created and used to replace the existing one, after which the old token can be removed.
error_outline The generated token is only shown once. If you lose it, you will need to generate a new one.
error_outline While we support multiple concurrent requests, schools still need to account for rate limits, especially when several users or systems use the API at once. To address this, schools can request dedicated API tokens for automation accounts. These tokens have their own separate rate limit of 1000 requests, independent of other users at the school. This means important automations can continue running reliably, as long as they stay within the token’s individual limit. More information can be found here.
Comments
0 comments
Please sign in to leave a comment.