Learn how to access Azion GraphQL API and the GraphQL playground.
Accessing GraphQL APISection titled 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 the 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 the 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:
Accessing GraphQL playgroundSection titled 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.
Watch a video tutorial on GraphQL’s first steps on Azion’s YouTube channel: