Insert excerpt | ||||||||
---|---|---|---|---|---|---|---|---|
|
Postman is an API platform that you can use to access the APIs. It can be downloaded from https://www.postman.com/downloads/ and you can select to either run it in a downloadable app or in the browser.
...
Create an Application Access in Usage Engine as described in Configuring Application Access. Ensure to copy the Client Secret since it will only be visible when creating the Application Access.
Either download the Postman app, or select to run it in a browser, and create an account and sign in.
Go to the workspace and import the OPEN API specification. The API specification can be downloaded from the endpoint of Usage Engine API page for your environment Environments .
Click on the REST API basics tutorial, and your workspace opens with a basic set of requests; GET, POST, PUT, DEL.
Select one of the methods and click on the Authorization tab to configure the application authentication.
Click on the Type drop-down and . The detailed documentation of the API is available on the same endpoint.
Go to the workspace and import the openapi.json specification in Postman as a Postman Collection.
Before accessing any API, you must create a bearer token.Select which endpoint you want to start using, for example List meter types. Navigate to Authorization tab, select OAuth 2.0.
Scroll down to the Configure New Token section.
Paste the Client ID and Client Secret details from the Configuring Application Access Application Access you created in Usage Engine in the first step.
Note!
You will see a warning advising you to use variables instead of entering the credentials in clear text. If you want to use variables, you can set this up by clicking on the Environments option in the navigation panel to the left in Postman.
...
Select Client Credentials in the Grant type drop-down.
...
Enter https://auth.digitalroute.io/auth/token in the Access Token URL field.
...
Define the audience of the token by scrolling down to the Token Request section select audience as Key in the table, enter the URL to the Usage Engine APIs, https://api.us.digitalroute.io/ in the Value field and leave the default setting Request Body in the Send In field as is.
...
Save your Authorization configuration to a collection by clicking on the Save button top right and either select an existing Collection, or create a new one.
...
Click on the Get New Access Token button.
...
If everything went well you will get a message saying “Authentication complete” and the Manage Access Tokens dialog will open displaying your token details.
...
as the authentication type. Configure getting the token by using
{{baseUrl}}/authentication/v1/oauth/token
(baseURL can be found in Environments ) and with the information provided by the Application Access. Pay attention Usage Engine CE Authorization endpoint uses "Send client credentials in body" as the Client Authentication method. We recommend using variables as in the example below.Add an additional Key in the token request named
audience
. Configure this to match the base url of the environment you are using Environments.
Note!
If the request are failing, check the URL for the audience
variable to contain the ending slash to the environment.
Once happy with you configurations, press “Get New Access Token”. This will generate a new access token.
Press proceed or wait a couple of seconds. Now you will be presented with the newly created access token. Press “Use Token”.
The token will now be added to the authorization header of your endpoint.
Update the body and query parameters with relevant parameters and send the request.
You can now create, list, update or delete the API endpoints provided by Usage Engine.
For more information on postman variables and environments, refer to Postman variable and environment. You can save the configuration of various environment like sandbox and production using environments in Postman.