Read and Review Automation Anywhere Documentation

Automation Anywhere Version 11.3

Close Contents

Contents

Open Contents

Retrieve a list of variables

  • Updated: 9/03/2021
    • 11.3.x
    • Explore
    • Enterprise

Retrieve a list of variables

Send a GET request to retrieve the string, list, and array variables used in a specific file.

Prerequisites

JSON Web Token (JWT)
All Control Room APIs require a JSON Web Token (JWT) to access the APIs. Generate an authentication token using the Authentication API.
Permissions
You must have permission for the folder in which you want to perform operations. If you can view bot details in the Control Room interface, then you can use this API.

See Bot Permissions for a Role.

Note:
  • Use the Swagger definition files installed with your Control Room to test the APIs. View the available Swagger APIs at http://<your_control_room_url>/swagger/.
  • You can also use a REST client to complete this task.

Procedure

  1. Add an authentication token to the request header.
    Note: Use the Authentication API to generate a JSON Web Token.
  2. Select GET as the method.
  3. In the URL, add the id and the File version for the file from which you are extracting variables.
    The File version can either be latest or production. The default value is latest.
    URL example:

    http://<your_control_room_url>/v1/repository/file/12/variables/latest

  4. Send the request.
    • In a REST Client, click SEND.
    • In the Swagger interface, click Execute.

    Response body:

    {
      "botVariables": {
        "stringValue": {
          "string": "xyz"
        },
        "listValues": {
          "list": [a, b, c, d]
        }
      }
    }
Note: You can also run REST requests from a command terminal. The following is a curl request example. This example is formatted for readability. Replace the text inside the angle brackets, <authentication_token>, with your authentication token.
curl -X GET "http://<your_control_room_url>/v1/repository/file/12/variables/latest" 
                    -H "accept: application/json" -H "X-Authorization: <authentication_token>"
Send Feedback