Generate an access token
To generate an access token four pieces of information are needed, as defined on the previous page
- client id: Your integrator id
- client secret: Your integrator secret
- Next database number: Identifies the Next Project customer instance you are integrating with (one integrator can be connected to several customers)
- One time api key: Used to authenticate the integration to talk to this specific Next Project customer instance/db.
Access tokens are created by using the https://next-tech.readme.io/reference/login_token_post endpoint.
With the information above, this is how you would input it in the endpoint page (grant_type: password is a constant):
Same example in Curl:
curl -X 'POST' \
'https://api.next-tech.com/v1/token' \
-H 'accept: application/json' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'grant_type=password&username=next_database_number&password=your_one_time_api_key&scope=&client_id=client_id&client_secret=client_secret'
In response to the above request, you will receive a JSON object containing the access token of type Bearer.
{
"access_token": "5109d8fc-aade-46ea-a355-2d707ba16b82",
"token_type": "bearer"
}
That token shall be included as an authorization header Bearer token in all further requests to the API as demonstrated in the curl command below for the List Projects endpoint.
curl -X 'GET' \
'https://api.next-tech.com/v1/project/?page=1&size=50' \
-H 'accept: application/json' \
-H 'Authorization: Bearer 5109d8fc-aade-46ea-a355-2d707ba16b82'
If you are using the endpoint page to test, you would input the Bearer token in the Authorization field in the top right corner:
Token info
An access token has no maximum lifetime but it can be revoked by deleting the API Key in Next. If you lose the token or if it is disabled, a new token must be created from Next as described above.
Updated 3 months ago