Click the Start a free trial link to start a 15-day SaaS trial of our product and join our community as a trial user. If you are an existing customer do not start a free trial.
AppDynamics customers and established members should click the sign in button to authenticate.
I am trying to access the REST API for an on-premises controller. I followed the instructions on this for my version of AppDynamics - API Clients (appdynamics.com)
I created an API Client, generated the client ID, secret and I am able to generate the token by accessing the 'controller/api/oauth/access_token' endpoint.
But when I use the Authentication token and/or the username/password for accessing any other endpoint, I am getting a 500 Internal Server Error response.
Any suggestions on how to resolve this?
Solved! Go to Solution.
Could you please do the following and let me know how it goes?
1. Go to the API Clients in Controller -> Go to the Settings => Administrator => API Client
2. Create an API client.
3. Enter the client Name, Description and Generate the Secret. Once the secret is generated, copy the secret and save it.
4. Assign the role.
4. Save it.
If you want to generate Token via CURL Command
5. run the below curl command to generate the token.
curl -X POST -H "Content-Type: application/vnd.appd.cntrl+protobuf;v=1" "https://test-controller.saas.appdynamics.com/controller/api/oauth/access_token" -d 'grant_type=client_credentials&client_id=<client-id>@account_name&client_secret=<secret>'
Replace <client-id> & <secret> accordingly.
client-id -> Client Name from Step 3
client_secret -> Secret from step 3
curl -X POST -H "Content-Type: application/vnd.appd.cntrl+protobuf;v=1" "https://test-controller.saas.appdynamics.com/controller/api/oauth/access_token" -d 'grant_type=client_credentials&client_id=sunil_api_client@ces-controller&client_secret=738e62b5-2455-45af-a644-934234234234'
Here is the docs for the details: https://docs.appdynamics.com/appd/23.x/latest/en/extend-appdynamics/appdynamics-apis/api-clients#id-...
Thanks for your response. I am able to complete the steps from your solution and get the access token. But when I try to use the access token to access other APIs.
curl --user <username>@customer1:<password> -H "Authorization:Bearer <ACCESS TOKEN> "https://<controller page>/controller/rest/applications"
I am getting the following error:
<html><body><h1>500 Internal Server Error</h1><br/>Exception Id:f08d81b3-42c6-4a1e-a9ad-882dd210bad9<br/></body></html>
The same response when I try without the Access token as well. I am not sure why this happens.
Thank you for providing the Curl command. I noticed that you've combined two different authorization methods in the same command, "Password-Based" and "Bearer Token." To proceed, please choose either "UsernamePassword" or "Bearer Token" for this command.
Here is the revised command; please try it and inform me of the results.
curl --user <username>@account-name:<password> "https://<controller page>/controller/rest/applications"
curl -H "Authorization:Bearer <ACCESS TOKEN> "https://<controller page>/controller/rest/applications"
That's excellent news. You can always utilize the "-v" verbose option in the Curl command to access additional details about errors and other related information, which can be invaluable for troubleshooting issues. As we discussed during the Webex call, the root cause of your API issues was the expired license. It's reassuring to hear that this matter has now been resolved.