...
Insert excerpt | ||||||||
---|---|---|---|---|---|---|---|---|
|
To use your APIs using curl command:
Create an Application Access in Usage Engine as described in Configuring Application Access. Ensure to copy the Client Secret during creation since it will only be visible at that time.
Call the authorization api with your Application credentials.
...
breakoutMode | full-width |
---|---|
language | bash |
...
Configure the audience based on which Environments you are calling.
Info |
---|
These examples use Production EU URL for accessing the APIs, update the URL based on your Environments . |
Code Block |
---|
client_id="f9bP7jTE63gNlA8jluCoPMs2ueP7si1L" client_secret="woN7vnKUVAC-y_WVd8Eih6R06mNfFA9V9ZUjid5Ae7iGE5R8Kll_fFY7EiRQ0d-9" curl "https://api.digitalroute.io/authentication/v1/oauth/token" \ -X POST \ -H "Content-Type: application/x-www-form-urlencoded" "https://api.digitalroute.io/authentication/v1/oauth/token" --data \ -d client_id=${client_id} \ -d client_secret="woN7vnKUVAC-y_WVd8Eih6R06mNfFA9V9ZUjid5Ae7iGE5R8Kll_fFY7EiRQ0d-9" --data client_id="f9bP7jTE63gNlA8jluCoPMs2ueP7si1L"${client_secret} \ -d grant_type="client_credentials" \ -d audience="https://api.digitalroute.io/" |
Example Response
Code Block | ||
---|---|---|
| ||
{ "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImZUYU5saGpnclFERE0xYkdVZG1WeiJ9.eyJhY2NvdW50SWQiOiJhZDZmZWM5NS1lMDYzLTQ5MmItOTJjYy01MmJiNjJjMGU3NTAiLCJpc3MiOiJodHRwczovL2F1dGguZGlnaXRhbHJvdXRlLmlvLyIsInN1YiI6IjhtMUhUMHA2SkdMOVJjbzhWNEZjWGZ2Y2dHejcwcms4QGNsaWVudHMiLCJhdWQiOiJodHRwczovL2FwaS5kaWdpdGFscm91dGUuaW8vIiwiaWF0IjoxNzE2NDY5Njg5LCJleHAiOjE3MTY0NzMyODksInNjb3BlIjoiY3JlYXRlOm1ldGVyX3R5cGVzIGNyZWF0ZTptZXRlcnMgZGVsZXRlOm1ldGVyX3R5cGVzIGRlbGV0ZTptZXRlcnMgcmVhZDptZXRlcl90eXBlcyByZWFkOm1ldGVycyB1cGRhdGU6bWV0ZXJfdHlwZXMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMiLCJhenAiOiI4bTFIVDBwNkpHTDlSY284VjRGY1hmdmNnR3o3MHJrOCJ9.WIK81gLKz0WKUDctehRdttTl0A5NvNmzop0DwEBPCfy3j9iCKESCpjHRfETqUqHRmKUIMiIgmramE-5qPLorKWheazK6AF5GHLCJ4on6u67-kUNm-EVM23USa0f0r0aA4u17xW9SXtJhJZg4XWjmnH_1YBxf5w4llwE1J61ldB3SxA7RtizN7c160wjBdr4iAHE8_0yxzbF4X1AgEHmtZEyBQdJE6JPl3Tp4cnE3kO4VPed5VCwlIKDedkN93k25UBWSrN1Oh88SBhkcueqnT_yIvd4vXwkXXJHMwf0ti6YrVeYh9yaSmeNBqSG2UbFP1_V-8GoX8U0GnlprYw6INw", "expires_in": 3600, "scope": "create:meter_types create:meters delete:meter_types delete:meters read:meter_types read:meters update:meter_types update:meters", "token_type": "Bearer" } |
Make a request to a protected resource with the access key in the Authorization authorization header.
Example of Calling the usage-metering API
Code Block | ||
---|---|---|
| ||
curl --location 'https://api.digitalroute.io/usage-metering/v1/meters?limit=100&skip=0' \ --headerH 'Accept: application/json' \ --headerH 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImZUYU5saGpnclFERE0xYkdVZG1WeiJ9.eyJhY2NvdW50SWQiOiJhZDZmZWM5NS1lMDYzLTQ5MmItOTJjYy01MmJiNjJjMGU3NTAiLCJpc3MiOiJodHRwczovL2F1dGguZGlnaXRhbHJvdXRlLmlvLyIsInN1YiI6IjhtMUhUMHA2SkdMOVJjbzhWNEZjWGZ2Y2dHejcwcms4QGNsaWVudHMiLCJhdWQiOiJodHRwczovL2FwaS5kaWdpdGFscm91dGUuaW8vIiwiaWF0IjoxNzE2NDY5Njg5LCJleHAiOjE3MTY0NzMyODksInNjb3BlIjoiY3JlYXRlOm1ldGVyX3R5cGVzIGNyZWF0ZTptZXRlcnMgZGVsZXRlOm1ldGVyX3R5cGVzIGRlbGV0ZTptZXRlcnMgcmVhZDptZXRlcl90eXBlcyByZWFkOm1ldGVycyB1cGRhdGU6bWV0ZXJfdHlwZXMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMiLCJhenAiOiI4bTFIVDBwNkpHTDlSY284VjRGY1hmdmNnR3o3MHJrOCJ9.WIK81gLKz0WKUDctehRdttTl0A5NvNmzop0DwEBPCfy3j9iCKESCpjHRfETqUqHRmKUIMiIgmramE-5qPLorKWheazK6AF5GHLCJ4on6u67-kUNm-EVM23USa0f0r0aA4u17xW9SXtJhJZg4XWjmnH_1YBxf5w4llwE1J61ldB3SxA7RtizN7c160wjBdr4iAHE8_0yxzbF4X1AgEHmtZEyBQdJE6JPl3Tp4cnE3kO4VPed5VCwlIKDedkN93k25UBWSrN1Oh88SBhkcueqnT_yIvd4vXwkXXJHMwf0ti6YrVeYh9yaSmeNBqSG2UbFP1_V-8GoX8U0GnlprYw6INw' |
...