Access and authentication for the REST API
The following flow chart explains the authentication process for accessing an API endpoint:
To access the API endpoint, perform these tasks:
Example of generating the JWT by using Postman
The following procedure explains how to use the Postman API client to generate the JWT to be used for authentication.
Obtain the access and secret keys as described in Setting up access keys for programmatic access.
- Open the Postman REST API client.
- Add a new request, and perform these steps:
- Select the operation as POST.
- Enter the following URL:
https://<BMC Helix Portal URL>/ims/api/v1/access_keys/login
Example: https://host1.bmc.com/ims/api/v1/access_keys/login On the Body tab, select raw, and add the following access and secret keys that you obtained in step 1 in this format:
{
"access_key": "string",
"access_secret_key": "string"
}Example:
{
"access_key": "A23G7QQYCGQW9Z2ZYXV67GB7K0PPNTU",
"access_secret_key": "2pcTmpbOVZFPj9FiSV5NWEOUMgbujtVPm9slQ43hIgBuEYbitu"
}- From the list, select JSON.
- Click Send.
The API response includes the token. - From the json web token parameter, copy the token.
Example of using the JWT for authentication by using Postman
The following procedure explains how to use the token for authentication for accessing the API to fetch the status of the agent data service.
- Open the Postman REST API client.
- Add a new request, and perform these steps:
- Select the operation as GET.
- Enter the following URL:
https://<BMC Helix Portal URL>/opt/api/agentdata/about
Example: https://host1.bmc.com/opt/api/agentdata/about - On the Authorization tab, select type as Bearer Token.
- In the Token box, add the token.
- Click Send.
The API response containing the service status is received.
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*