Authentication
To use some of the SuperViz API endpoints, you need to authenticate your requests, by using the Bearer token in the request header. Here are the steps to authenticate your requests:
1
Before we start
Make sure you have a SuperViz account. If you don't have one, you can create one for free.
2
Login to get the token
In order to get the token, you need to log in to the SuperViz API. You can do this by sending a POST request to the /login
endpoint with your email and password.
curl -X POST https://nodeapi.superviz.com/login \
-H 'Content-Type: application/json' \
-d '{
"email": "YOUR_EMAIL",
"password": "YOUR_PASSWORD"
}'
3
Get the token
As a response to the request, you will receive a 200 (Ok) Status Code and a JSON object containing the access_token
.
The access_token
is a JWT token that you will need to include in the header of all your requests to the SuperViz API.
{
"access_token": "YOUR_ACCESS_TOKEN",
"name": "YOUR_NAME",
}
4
Use the token
Now that you have the token, you can use it to authenticate your requests to the SuperViz API. To do this, you need to include the token in the Authorization
header of your requests. The endpoints that require Bearer authentication will be mentioned in the documentation.
curl https://nodeapi.superviz.com/groups/ \
-H "Authorization: Bearer ${TOKEN}"
Some endpoints may also need the use of your API key (also known as Developer Token), which is provided by the SuperViz dashboard, to, not only determine in which environment the request is being made but also to add a layer of security to the request.
Don't worry, it will be mentioned in the documentation.