First Steps GraphQL API
Learn how to access Azion GraphQL API and the GraphQL playground.
1.1 Accessing GraphQL API
To use GraphQL API with API platforms such as Postman and Insomnia, you first need authentication to ensure requests access data securely. This authentication occurs through Tokens.
To create a Token, you can follow two different paths:
- Use Azion API platform.
- Use Real-Time Manager (RTM).
The second option is to create a Personal Token through Azion configuration interface, Real-Time Manager (RTM). This option is more suitable for use with APIs due to the possibility of creating a long-lived token. See the Personal Tokens documentation page to create one.
When creating a Personal Token, you’ll have to set an expiration date. For use with APIs, it’s recommended to set a longer expiration date, such as 90 days or 1 year. In that case, make sure you take necessary precautions to ensure your project’s security.
After creating your Personal Token, head to the API platform you’ll be using and include the Azion GraphQL API endpoint in your request:
- To use the Metrics API for aggregated data, include:
- To use the Events API for raw data, include:
1.2 Accessing GraphQL playground
You can use Azion GraphQL built-in playground to write, validate, and test GraphQL queries. Using the playground can help you become more familiar with the API and the use of queries in a visual and quick manner.
After successfully logging in to RTM, go to
https://api.azionapi.net/events/graphql and interact with the GraphQL playground.
Didn’t find what you were looking for? Open a support ticket.