Authentication
Authentication is a fundamental step in ensuring security and controlled access to our API features.
In this section, we will explain how to obtain and use the authentication token required to authenticate your requests.
Obtaining the authentication token
To access API features, you must obtain a valid authentication token. Follow the steps below to start the authentication process:
Step 1: Open a technical support ticket
The values of the base_URL
, scope
, client_id
and client_secret
from the authentication process are provided by NDD technical support.
Open a technical support ticket through the ticket portal and request these values to perform authentication.
Step 2: Request the authentication token
With the values of the base_URL
, scope
, client_id
and client_secret
in hand, you can request an authentication token. Use the following information to make the request:
POST /connect/token
BODY
Parameter | Description | Type | Required |
---|---|---|---|
grant_type | Specifies the type of authentication grant (grant type) being used. Use the value client_credentials . | string | Yes |
scope | Defines the requested access scopes, separated by spaces. Use the value provided by technical support, as in step 1 above. | string | Yes |
client_id | The identifier registered on the authorization server. Use the value provided by technical support, as in step 1 above. | string | Yes |
client_secret | The secret associated with the client_id .Use the value provided by technical support, as in step 1 above. | string | Yes |
NDD considers one integration per provider. Therefore, the client_id
and client_secret
of a provider cannot be reused in the integration of other providers.
Request example
Request the authentication token for the provider's Organizational structure and Printers APIs.
Replace <base_URL>
, <scope>
, <client_id>
and <client_secret>
with the values provided by technical support in step 1:
curl -L -X POST ‘<base_URL>/connect/token’ \
-H ‘Content-Type: application/x-www-form-urlencoded’ \
-d ‘grant_type=client_credentials’ \
-d ‘scope=<scope> <scope>’ \
-d ‘client_id=<client_id>’ \
-d ‘client_secret=<client_secret>’
Response example
The response code 200 indicates that the request was successfully completed and will return the JSON with the authentication token access_token
:
{
"access_token": "1234567890",
"expires_in": 3600,
"token_type": "Bearer",
"scope": "core printer"
}
The generated authentication token is valid for 60 minutes. After this time has elapsed, generate another token.
Using the authentication token
To authenticate your requests to the API, you must include the authentication token obtained in the header of your requests. It is a mandatory parameter for all calls.
Access the guidelines on how to use it at Required parameters.