cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Tran.Vinh
Creator

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!



23 REPLIES 23

Mario.Morelli
Architect

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



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

Learn more about me in the Community Member Spotlight Q & A

Tran.Vinh
Creator

Hi Mario,
Nothing response

TranVinh_1-1676967689445.png

 

Mario.Morelli
Architect

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

 

 

 

 



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

Learn more about me in the Community Member Spotlight Q & A

Tran.Vinh
Creator

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

TranVinh_0-1676970601347.png

 

Tran.Vinh
Creator

this is the response after changed

TranVinh_0-1676970808876.png

 

Mario.Morelli
Architect

Hi Tran

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



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

Learn more about me in the Community Member Spotlight Q & A

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

 

Mario.Morelli
Architect

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.



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

Learn more about me in the Community Member Spotlight Q & A

Tran.Vinh
Creator

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.