Skip to main content

I wrote a bot and want to use an API to check if a certain bot is running.
I successfully obtained a token using REST Web Services: Post method from the package,However, I encountered a problem afterwards.

I tried using REST Web Services: Get method to retrieve running bots:

(URL: http://myurl.com.tw/v2/activity/list?status=RUNNING&page=1&size=100)


After execution, I got a 404 error message saying the resource couldn't be found.
So I changed it to:


Now I'm getting 401 Unauthorized. Authentication for the URI failed.

Can someone tell me what the problem is? Thank you

That’s an interesting question, LHJ !

I think the following community members may be able to help 

@Marc Mueller 

@Vatsy 

@Zaid Chougle 

@Tamil Arasu10 

@madhu subbegowda 

@jackson 

@HARUN KUMAR 

@NewTushitha 

@Azhar Hossain 

@kdil 

@Padmakumar 


Hi ​@LHJ,

I believe Parameters is not correct.
Could you please revise the method like a  below and remove the content type?

 

 

 

 


Hi ​@LHJ 

Based on your issue and what I can see, ​​​​​​

  • First URL (/v2/activity/list?...): Gave a 404 Not Found --> The endpoint likely doesn't exist or is incorrect.
  • Second URL (/v1/devices): Gave a 401 Unauthorized --> The authentication method or token format is likely incorrect or missing.

Lets take step-by step to fix this:

  1. Make sure the base URL + endpoint you're using is correct:
    For checking running bots in Automation Anywhere Control Room, the endpoint is typically:
    https:///v2/activity/list?status=RUNNING&page=1&size=100

       Check:

  • Is http://myurl.com.tw the correct Control Room URL?
  • Is the API version (v1 vs v2) correct?

If you are unsure verify it via https://docs.automationanywhere.com/bundle/enterprise-v2019/page/enterprise-cloud/topics/control-room/control-room-api/cloud-control-room-apis.htmlor from your Control Room → API Swagger UI.

  1. Your current setup:
    X-Authorization: Bearer $token$

    But for v2 APIs, the expected header is:

    Authorization: Bearer <access_token>
    So update the header name from X-Authorization to Authorization.

  2. Ensure you are:
    You’re passing the exact same token returned from your POST login method.
    You’re not using a stale/expired token.
    You don’t include extra spaces/quotes in the variable.

  3. Try updating your REST Web Services: Get method configuration as:

  • Authentication Mode: No Authentication
  • Header:
  1. Name: Authorization
  2. Value: Bearer $token$
  3. Name: Content-Type
  4. Value: application/json
  5. And ensure the full URI is like: https://your-controlroom-url.com/v2/activity/list?status=RUNNING&page=1&size=100

 

Also, make sure if your Control Room uses HTTPS, always use https:// (not http://). And try calling the API in Postman or browser to validate the token and endpoint first, before using in bot.

Happy to assist!


Hi ​@LHJ,

I believe Parameters is not correct.
Could you please revise the method like a  below and remove the content type?

 

 

 

 

 

Hi Tamil Arasu10,
I update the header name from X-Authorization to Authorization and got a 401 error after execution.
Every time I execute, I start by getting a token from the post request.
Does this mean the token is not valid?

 


Hi ​@LHJ 

Based on your issue and what I can see, ​​​​​​

  • First URL (/v2/activity/list?...): Gave a 404 Not Found --> The endpoint likely doesn't exist or is incorrect.
  • Second URL (/v1/devices): Gave a 401 Unauthorized --> The authentication method or token format is likely incorrect or missing.

Lets take step-by step to fix this:

  1. Make sure the base URL + endpoint you're using is correct:
    For checking running bots in Automation Anywhere Control Room, the endpoint is typically:
    https:///v2/activity/list?status=RUNNING&page=1&size=100

       Check:

  • Is http://myurl.com.tw the correct Control Room URL?
  • Is the API version (v1 vs v2) correct?

If you are unsure verify it via https://docs.automationanywhere.com/bundle/enterprise-v2019/page/enterprise-cloud/topics/control-room/control-room-api/cloud-control-room-apis.htmlor from your Control Room → API Swagger UI.

  1. Your current setup:
    X-Authorization: Bearer $token$

    But for v2 APIs, the expected header is:

    Authorization: Bearer <access_token>
    So update the header name from X-Authorization to Authorization.

  2. Ensure you are:
    You’re passing the exact same token returned from your POST login method.
    You’re not using a stale/expired token.
    You don’t include extra spaces/quotes in the variable.

  3. Try updating your REST Web Services: Get method configuration as:

  • Authentication Mode: No Authentication
  • Header:
  1. Name: Authorization
  2. Value: Bearer $token$
  3. Name: Content-Type
  4. Value: application/json
  5. And ensure the full URI is like: https://your-controlroom-url.com/v2/activity/list?status=RUNNING&page=1&size=100

 

Also, make sure if your Control Room uses HTTPS, always use https:// (not http://). And try calling the API in Postman or browser to validate the token and endpoint first, before using in bot.

Happy to assist!

Hi madhu subbegowda,
I confirmed that my URL and API version are correct,
and I also modified the header as mentioned in my previous reply, resulting in a 401 error.
Does this mean the token is not valid?


Hi ​@LHJ, Could you please try with postman and If that works, replicate the same for A360


Hi ​@LHJ  - yes — it likely means the token is invalid or not accepted by the endpoint.

1. Token Format

  • Check how the token is being passed.
  • If you're using X-Authorization: $token$, try changing it to the standard:

makefile

CopyEdit

Authorization: Bearer <your_token>

In Automation Anywhere’s REST Web Services package, this would be:

    • Header Name: Authorization
    • Header Value: Bearer $token$

2. Token Scope / Permissions

  • Ensure that the token you obtained has permission to access the /v2/activity/list endpoint.
  • Some tokens are restricted based on roles or scopes (e.g., admin vs. bot runner).

3. Token Expiration

  • Tokens often expire within minutes or hours. Make sure you are using a freshly generated token.

4. API Base URL vs Endpoint Version

  • Confirm that /v2/activity/list is supported by your Control Room’s version.
  • Some endpoints (like /v1/devices) may work with the token, while newer /v2/* might need elevated access or a different token type (e.g., OAuth vs. basic auth token).

5. Confirm Token in Postman or Curl

  • If possible, test the same call using Postman with:
    • Authorization header set as: Bearer <your_token>
    • This can help isolate whether the problem is in the bot or the token itself.

Example Header Setup:

{

  "Authorization": "Bearer eyJhbGciOiJIUzI1NiIs...",

  "Content-Type": "application/json"

}

 

 


@LHJ what is the Version of A360 you are using, if V31 execution orchestrator apis are in V3
 

 

Also you can get list of apis by using https://url/swagger


Reply