Skip to main content
Question

Using generated API key


Forum|alt.badge.img+2

Hello, I’m not an AA user but want to use AA Rest APIs.

My AA admin has generated an API key for me to use but I’m not able to authenticate using that API key.

AA Admin followed below steps

  1. Created a role with permission “Generate API Key”
  2. Assigned this role to the service account I want to use
  3. Generated API key by going to user setting page

 

Now I’m trying to generate the token to use REST APIs in postman but getting “Access Denied” error.

 

Any suggestion will be helpful.

Forum|alt.badge.img+1
  • Cadet | Tier 2
  • December 20, 2024

if you want to check. Is token key valid?

just pass token in header not in Body.

your body parameters are for another method looks like.

documentation says: just use token

 


Forum|alt.badge.img+2
  • Cadet | Tier 2
  • December 20, 2024

It says false but thats the token I got from control center and profile in AA portal says API key is active and doesn’t expire until 2052

 

 


Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+10
  • Automation Anywhere Team
  • December 20, 2024

@sudhik.sk You are using the wrong API call for authentication. It should be:

https://yourcontrolroom/v2/authentication

A “token” is what is returned from authentication. It is NOT your API key.

Also know the v1/authentication is deprecated and will always return a failure message.

Go to https://yourcontrolroom/swagger/  (be sure to include the trailing slash) for more information.


Forum|alt.badge.img+2
  • Cadet | Tier 2
  • December 20, 2024

using v2, I’m getting below error

{
    "code": "generic.server.exception",
    "details": null,
    "message": "An unexpected problem occurred"
}

 


Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+10
  • Automation Anywhere Team
  • December 20, 2024

Please show your request.

The body sent over, since you’re using an API key, should look like this (key is case-sensitive):

{“apiKey”:”asdfasdfasdfasdf”}


Forum|alt.badge.img+2
  • Cadet | Tier 2
  • December 20, 2024

Yes, I’m sending the key as it should be sent.

 

 


Forum|alt.badge.img+2
  • Cadet | Tier 2
  • December 27, 2024

Hey, I even got my user account to have admin access and tried to generate a token using my username and password but that throws the same error too. In v1, it says access denied and in v2, it gives internal server error.

 

Do I need to enable something else in A360 to use the control room APIs?


Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+10
  • Automation Anywhere Team
  • December 27, 2024

Why are you sending the username AND the API key? That's not what I posted. 

Make sure you have API access for the user account you're using to access the API. 


Forum|alt.badge.img+2
  • Cadet | Tier 2
  • December 28, 2024

I tried only sending api key. In v1, I get same “Access denied” error. In v2, I get below error

 

```

{

    "code": "UM1110",

    "details": "This may be due to a misspelling or because your Caps Lock is on. To continue, please retype your username and password.",

    "message": "Either your username or your password is incorrect"

}

```


Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+10
  • Automation Anywhere Team
  • December 28, 2024

V1/authentication is deprecated. Do not use it. ⛔

Sounds like the user account you generated the API key for does not have the correct privileges. Check that the user that you generated the API key for has API privileges. 


Forum|alt.badge.img+2
  • Cadet | Tier 2
  • December 28, 2024

What privileges are required? I tried with two user accounts one with system admin privileges too and that didnt work either 


Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+10
  • Automation Anywhere Team
  • December 28, 2024

They need a role that contains Generate API-Key options. It's recommended you create a separate user for API access. 


Forum|alt.badge.img+2
  • Cadet | Tier 2
  • December 28, 2024

That’s what we did. We created a new role with that permission and assigned that role along with some other roles to a new user for whom I created the api key


Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+10
  • Automation Anywhere Team
  • December 28, 2024

I would recommend reaching out to your CSM at this point in case there is some customization in your environment. 

I have no problem accessing our APIs using PHP on a separate web server. 


Forum|alt.badge.img+2
  • Cadet | Tier 2
  • December 28, 2024

Yes, waiting for the support to respond. Thanks for all the help, I’ll let this thread know of the solution once I know


Forum|alt.badge.img+2
  • Cadet | Tier 2
  • January 6, 2025

It was probably an issue with our firewall but URL “{{baseUrl}}/v2/authentication” works fine


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings