Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info

Example - Getting an OAuth 2 Token Using curl

This works in bash and zsh. To avoid exposing the credentials we are storing them in variables. For information about how to define variables in any other environment, see the respective documentation. The Client Secret is sensitive information and it is important not to expose it unnecessarily.The audience is the API address you are going to send requests to. Read more at Getting started with APIs using Curl

Code Block
client_id={{your client ID}}                       
client_secret={{your client secret}}
audience={{your api environment}}
curl --location --request POST 'https://api.digitalroute.io/authentication/v1/oauth/token' \
        --header 'Content-Type: application/x-www-form-urlencoded' \
        --data client_id=${client_id} \
        --data client_secret=${client_secret}' \
        --data grant_type="'client_credentials"' \
        --data audience=${audience} 
        

...