Splunk AppDynamics

unable to get token via api https://accountName.saas.appdynamics.com/controller/api/oauth/access_token

Tran_Vinh1
Explorer

I follow up on this doc to generate tokens via API but I didn't receive any response from the server.
https://docs.appdynamics.com/appd/4.5.x/en/extend-appdynamics/appdynamics-apis/api-clients#APIClient...
the curl like below:

curl -X POST -H "Content-Type: application/vnd.appd.cntrl+protobuf;v=1" "https://(accountName).saas.appdynamics.com/controller/api/oauth/access_token" -d 'grant_type=client_credentials&client_id=(username)@(accountName)&client_secret=(clientsecret)'
Please help me!



Labels (3)
0 Karma
1 Solution

zhouyaoji
Path Finder

@Tran.Vinh, I spoke to our engineer again, and his last suggestion was to make sure your client secret was correct as well, even if that means generating a new one. If that doesn't work, please go to https://help.appdynamics.com/hc/en-us/requests and file a ticket, so our customer support team will look into it. I'd also make sure that the client name and account name don't have any trailing spaces. I hope regenerating a client secret helps, but if not, I'm sorry I couldn't help you.

View solution in original post

0 Karma

iamryan
Community Manager
Community Manager

Hi @Tran.Vinh,

I'm also trying to figure this out. I'll report back when I get an answer. 

0 Karma

Tran_Vinh1
Explorer

@Mario.Morelli 
Sorry If I interrupt you but could you confirm for me about the trials controller can not get tokens via API? If you can not so Can you please give me the contact of people who can answer my question above?
Thanks.

0 Karma

Tran_Vinh1
Explorer

I tried on another Linux machine but I still got the same situation.
Our company considering to use appDynamic as a monitoring server for our application and we would like to have a way to get the token dynamically via API so you can help me confirm that the trial controller can not use this feature.

0 Karma

Morelz
Builder

I would possibly try the request on another machine, I see you have a Macbook. Can you check another Linux machine?

Or it might be a limit on using the API Client when it's a trial controller, I would suggest to log a case to AppDynamics support to check if this is the case, as your request is correct, I have used your exact call, and replaced with my own details and it works.

Morelz
Builder

Hi Tran

Your syntax is 100% correct, is this a trial controller?

0 Karma

Tran_Vinh1
Explorer

yes, this is the trial controller and the syntax is correct.

0 Karma

Tran_Vinh1
Explorer

this is the response after changed

image.png

0 Karma

Tran_Vinh1
Explorer

After changing clientId = clientName of my API client but I still cannot get the response from the server.

image.png

0 Karma

Morelz
Builder

If you get no response, something is wrong with one of the 3 below

client_id, accountname or client secret

Can you double check, that under Administration that the Client Id for the API Client is correct, account name of your controller, as well as the secret(All Case sensitive)

Just validating that the client_id value is the Client Name value that you have created for the API Client, not the username that you login to AppD with.

Ciao

Tran_Vinh1
Explorer

Hi Mario,
Nothing response 😞

image.png

0 Karma

Morelz
Builder

Hi Tran

Can you share a screenshot of what response you get from the terminal when running the POST command(Just hide sensitive data).

Thanks

0 Karma
Get Updates on the Splunk Community!

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL  The Splunk AI Assistant for SPL ...

Buttercup Games: Further Dashboarding Techniques (Part 5)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...

Customers Increasingly Choose Splunk for Observability

For the second year in a row, Splunk was recognized as a Leader in the 2024 Gartner® Magic Quadrant™ for ...