ASM - Error creating access token through the ASM API

book

Article ID: 211448

calendar_today

Updated On:

Products

CA App Synthetic Monitor

Issue/Introduction

After generating the client_id succesfully through the ASM API, the following error is occuring when trying to create the new Access Token as instructed in the ASM documentation, eg:

curl -X POST "https://api.asm.ca.com/v3/oauth2/token" -H  "accept: application/json" -H  "Content-Type: application/x-www-form-urlencoded" -d "grant_type=client_credentials&client_id=hYlUMFbgPVG6R0FlyIuxsnSbEMVt5HEmzdF52m9KX%2BU%3D&client_secret=CzkfkZMFv%2FXkC5NA%2BGfRIBC2WlMSA9zFnmYpkMlggSI%3D"


"error": "invalid_client"
"error_description": "Either the client_id does not exist or the client_secret is incorrect"

 

Environment

Any release

Resolution

In order to resolve this problem please try the following:

- URL encode the client_id and secret_id. You can use below online tool to do so:
https://www.urlencoder.org/

- Then, pass the client_id and secret_id in the URL encoded format to the curl command

Additional Information

Create a New Access Token and a Refresh Token From the Client Credentials
https://techdocs.broadcom.com/us/en/ca-enterprise-software/it-operations-management/app-synthetic-monitor/SaaS/using/using-swagger-in-dx-asm/Swagger-API-Examples.html