The Qualio API Workflow
Using the API requires basic technical knowledge. This tutorial shows how to access the API and how to trigger basic actions. The examples presented here are not based on a specific programming language, they can be rewritten into any language, e.g. Java or PHP.
Get your token
API queries are executed remotely (i.e. outside of our application), so you need to authorize them with a special token.
In order to get your token, you need to log in to Qualio application and go to access settings. Please click on the settings icon (“Cog” icon) and select "Account Settings". Select from the left panel: "API Access". You can get there directly by clicking on this link: https://app.qualio.com/account/access. Access to the link must be enabled for users. Contact the Qualio Support team or your Customer Success Representative to request access.
API Access settings page
Click "Generate API Token". This will create a token for remote access to the API. Remember to guard your token. If it is in the wrong hands, you should remove it ("Refresh" button) or change it ("Refresh" button).
API Access settings page with generated Token
First call
If you already have your token you can make your first query to the API. In this case, you need a tool that is able to send requests to the servers. In our example, this will be the "curl" command, which is delivered by default to the UNIX/MacOS systems. Of course, this is not the only possible tool, especially if the booths provide ready-made packages to execute requests to the servers (e.g. "requests" package for Python).
For Windows users, it is also possible to install curl (https://curl.haxx.se/windows/), but if you just want to test the API we recommend to read the section: Test API with GraphiQL
Open the terminal window in your operating system and type in the following command:
curl https://api.app.qualio.com/pa/ -H 'Authorization: Bearer YOUR_SECRET_API_TOKEN -H 'Content-Type: application/json' -X POST -d ' { "query": "{ me { fullName } } " } '
Remember to replace "YOUR_SECRET_API_TOKEN" with the previously generated token.
Confirm the command with the ENTER key. You should get the following result:
{"data":{"me":{"fullName":"Your Full Name"}}}
What happened:
Using the "curl" command, we sent a request to the Qualio server. As part of the request, we sent:
a token that allows you to identify the user and confirm access to the resources
query asking for the full name of the user who sent the request.
As a result, we received data in JSON format (https://www.json.org/) containing the full name of the user who sent the query.
Notes for developers:
Sending a request to the API requires:
use the target API address: https://api.app.qualio.com/pa/
additional authorization header in the format:
Authorization: Bearer YOUR_SECRET_API_TOKEN
send a query in body message in JSON format
The query itself should be constructed using GraphQL syntax
What’s next?
We are able to send a remote query to the API. In order to take full advantage of its capabilities, it is necessary to get acquainted with the GraphQL language (https://graphql.org/ ). It is a modern solution that allows you to build flexible queries, giving you more possibilities in obtaining and modifying data.
After reading the GraphQL language, we encourage you to familiarize yourself with the developer documentation under the link: https://graphql.app.qualio.com/pa/docs/.
More advanced examples of queries, as well as how to test GraphQL, can be found HERE.