Not a customer? Click the 'Start a free trial' link to begin a 30-day SaaS trial of our product and to join our community.
Existing Cisco AppDynamics customers should click the 'Sign In' button to authenticate to access the community
02-20-2023 11:10 PM
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!
Solved! Go to Solution.
03-16-2023 06:37 PM
Hi @Joe.Catera
I attached the image of the account name and client_name in some pictures below. Please help me check on the issue 401
Thanks
03-17-2023 11:49 AM
@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.
03-20-2023 03:29 AM
@Joe.Catera
It worked well after I got support from the customer support team.
Thank you so much.
04-04-2023 02:50 PM
Hi Tran.vinh, if you would like another example of how to get a token using an API secret, i'm doing the following on my rapport application: (https://github.com/open768/appdinc/blob/main/auth.php its in php, but hopefully you get the gist)
the querystring i use is
$oHttp->request_payload =
"grant_type=client_credentials&" .
"client_id=$app@$account&" .
"client_secret=$api_secret";
with extra headers:
$oHttp->extra_headers = ["Content-Type" => "application/vnd.appd.cntrl+protobuf;v=1"];
then do a GET request to the API for your controller "/api/oauth/access_token"
this returns the access token to use for the API.
HTH
01-31-2025 09:40 AM
I know this is an older post, but we are experiencing the same issue, and are using the same curl statement parameters. What did the support team do to correct the issue for you?
02-03-2025 01:29 PM
Hi @Tran.Vinh , @sunil.vanmullem
Can you offer any help to Clarence based on your experience with this?
Thanks,
Ryan, Cisco AppDynamics Community Manager
Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.
Check out Observabiity in Action
new deep dive videos weekly in the Knowledge Base.
02-03-2025 08:36 PM
02-04-2025 01:22 AM
I'm having the same issue and it started happening a few days ago. The CURL command from the docs still throws 401.
02-04-2025 01:24 AM
Update your Content-Type to this and it will work again, it is mentioned in the release notes of the last Controller Update -
{"Content-Type": "application/x-www-form-urlencoded"}
02-04-2025 01:53 AM
As I said, the CURL command from the docs doesn't work. It already has a content-type header: https://docs.appdynamics.com/appd/24.x/24.12/en/extend-cisco-appdynamics/cisco-appdynamics-apis/api-...
Not even mentioning there's two different commands in the example, one with basic auth added. I've tried all combinations of my username, domain, API client and still getting 401.
$ curl -i -X POST -H "Content-Type: application/x-www-form-urlencoded" "https://mothership2019052316285110.saas.appdynamics.com/controller/api/oauth/access_token" \
-d 'grant_type=client_credentials&client_id=EnterpriseTest@mothership2019052316285110&client_secret=<secret>'
HTTP/1.1 401 Unauthorized
Content-Type: text/html; charset=UTF-8
Content-Length: 204
Connection: keep-alive
x-frame-options: SAMEORIGIN
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
cache-control: must-revalidate,no-cache,no-store
last-modified: Tue, 28 Jan 2025 08:17:18 GMT
accept-ranges: bytes
x-envoy-upstream-service-time: 13
date: Mon, 03 Feb 2025 22:38:47 GMT
server: istio-envoy
x-envoy-decorator-operation: pdx-p-con-437-svc.pdx-p-con-437.svc.cluster.local:8079/*
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Unauthorized</title>
</head>
<body>
HTTP Error 401 Unauthorized
<p/>
This request requires HTTP authentication
</body>
</html>%
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
Thank you! Your submission has been received!
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form