AppD Archive

REST API Question

CommunityUser
Splunk Employee
Splunk Employee

In regards to the REST API, what does the "account-id" parameter refer to, and how can I find it in my environment? I'm trying to follow the instructions listed in the documenation (https://docs.appdynamics.com/display/PRO39/Use+the+AppDynamics+REST+API) so that I can create action suppressions remotely, but I don't know what to put in for account-id.

0 Karma
1 Solution

Arun_Dasetty
Super Champion

Hi Jordan,

What is the controller version ? we tried in one of our demo site running on 3.9.5.2 and it shown fine, the same did not work for us in older controller version:

image.png

Regards,

Arun

View solution in original post

0 Karma

Angela_Lang
Path Finder

Try Customer1. If you have installed an on-premise Controller on a single-tenant platform or if you are using the AppDynamics SaaS Controller, your default account is "customer1".

CommunityUser
Splunk Employee
Splunk Employee

I tried customer1... it didn't work. I did have that in my authentication credentials, but it seems to be expecting something else entirely for this account-id parameter. In the example that they give, the account-id was just the number 2 (which, of course, I tried but had no success).

0 Karma

Angela_Lang
Path Finder

You can get a list of your applications and their IDs using this rest call:

URI: /controller/rest/applications

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

That gives me the application IDs, but not the account-id.....

0 Karma

Angela_Lang
Path Finder
If you are a saas customer, your account name (and account-id) is the segment preceding saas in your SaaS URL. For example, if your URL is:
myComp.saas.appdynamics.com, Your account name would be:  myComp
0 Karma

CommunityUser
Splunk Employee
Splunk Employee

We're not a SaaS customer, we're on-premise......

0 Karma

Arun_Dasetty
Super Champion

Hi Jordan,

Can you run the following query at controller mysql db prompt and see if that helps:

shell> cd <Controller_install_dir>\bin

shell> controller.bat/sh login-db

mysql> select name,account_id from user \G;

mysql> select id,name from account \G;

First query will give users and there account ids and account table list the details of account. 

Regards,

Arun

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

I ran the queries you suggested and only get two IDs: 1 and 2. Looks like 1 refers to the local AppDynamics accounts and 2 refers to the Active Directory accounts. However, no matter whether I use 1 or 2 as the account-id, I still can't get a response from the REST call. I get a "HTTP Status 400 - Unsupported URI is specified" HTML response.

It doesn't help that the documentation specifies two different URIs for the same action (I've tried both, but neither work):

/controller/rest/accounts/<account-name>/applications/<application-name | application-id>/actionsuppressions

/controller/api/accounts/<account-name>/applications/<application-name | application-id>/actionsuppressions

0 Karma

Arun_Dasetty
Super Champion

Hi Jordan,

GET HTTP method is for retrieve any action supression list and POST is for create supression lists, Can you provide the exact URL you tried and error you got on browser for GET requests and also the output of following queries issued at controller db:

mysql> select * from application \G;

mysql> select * from account \G;

This information helps us to see whether valid id passed or not.

Regards,

Arun

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Right now I'm just attempting to do a GET request to retrieve all existing action suppressions. The URL I am trying is:

http://s-appdynamics01.janus.cap:8090/controller/rest/accounts/2/applications/2/actionsuppressions

The error I get when trying the URL is:

HTTP Status 400 - Unsupported URI is specified


type Status report

messageUnsupported URI is specified

descriptionThe request sent by the client was syntactically incorrect (Unsupported URI is specified).


GlassFish Server Open Source Edition 3.1.2.2

I have attached a screenshot of the output from the mysql queries you asked for.

0 Karma

Arun_Dasetty
Super Champion

Hi Jordan.

 Can you try the following URI format and see if that helps ?

Ex:

/controller/api/accounts/2/applications/9/actionsuppressions

Regards,

Arun

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

When I try that format, I get the following HTML error:

HTTP Status 404 - Not Found


type Status report

messageNot Found

descriptionThe requested resource (Not Found) is not available.


GlassFish Server Open Source Edition 3.1.2.2

0 Karma

Arun_Dasetty
Super Champion

Hi Jordan,

What is the controller version ? we tried in one of our demo site running on 3.9.5.2 and it shown fine, the same did not work for us in older controller version:

image.png

Regards,

Arun

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Ah, maybe that's it...... looks like we're running on 3.9.4.0 build 7. Can you confirm that that version does not have this capability?

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Ah, I just found the missing detail in the documentation. It says "New in 3.9.4.1". We're 0.0.0.1 version off!  >_<

Thanks for all your help on this.

0 Karma
Get Updates on the Splunk Community!

.conf25 Community Recap

Hello Splunkers, And just like that, .conf25 is in the books! What an incredible few days — full of learning, ...

Splunk App Developers | .conf25 Recap & What’s Next

If you stopped by the Builder Bar at .conf25 this year, thank you! The retro tech beer garden vibes were ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...