Read and Review Automation Anywhere Documentation

Automation 360

Close Contents

Contents

Open Contents

Deploy bots API

  • Updated: 6/29/2021
    • Automation 360 v.x
    • Manage
    • RPA Workspace

Deploy bots API

As a user with a Bot Runner license, deploy bots on your assigned devices. You can also pass variables to bots when they are deployed.

Prerequisites

Note: You can view the Control Room APIs in the Community Edition, but API functionality is limited. You need a licensed Automation 360 Edition to access the full functionality of the APIs.
Ensure that you are allocated the following resources:
  • View and Run my bots feature permission
  • Run and schedule permissions for the folders that contain the bots
  • Access to Bot Runner licensed users
  • Access to either a default device or a device pool
    Note: If the user associated with the Bot Runner license has a default device assigned to their account, the bot deploys on that device. If no default device is assigned, or you want to select a different device, then you must specify a device pool.
Output variables: There are two ways to return the value of output values:
  • Callback response: If you define the callback sever in the request, the Control Room will send the values of output variables to the callback server. See this example request.

    You must define an output variable in the bot to retrieve the output value in the API response. Create a variable

  • Use the Bot Scheduler APIs to schedule the bot to run one time or on a recurring basis. The API response includes the output variable values.

To deploy a bot and pass a variable value to the bot, you provide the following information to the API:

Parameter Required Type Description
fileId Yes Number Identifier for the bot to be deployed.

List files and folders by workspace API

runAsUserIds Yes Number Identifier for a user that is registered with your Control Room as an Unattended bot runner.

List available unattended Bot Runners API

poolIds No Number Identifier of a device pool that has at least one active device. If you enter multiple pool IDs, enter the values in the order of which you want the API to check for available devices. If none of the devices are available at the time of deployment, the automation is queued.
Note: If the user associated with the Bot Runner license has a default device assigned to their account, the bot deploys on that device. If no default device is assigned, or you want to select a different device, then you must specify a device pool.

List device pools API

overrideDefaultDevice No Boolean If the Bot Runner user is assigned to a default device and you want to specify a device pool, set this parameter to true.

If deploying to the default device, set this parameter to false.

botInput No Varies Specify the input variable name, value, and data type.
numOfRunAsUsersToUse No Number Specifies how many Bot Runners to use from the list of runAsUserIds. A weighted system algorithm selects the Bot Runners with the least number of queued tasks.
callbackInfo No Object Provides the URL and authentication token for the callback server. After the bot is deployed, the Control Room sends the deployment status and output variable values to this callback server.

Procedure

  1. Add the authentication token to the request header.
  2. Use the POST method and endpoint URL: <your_control_room_url>/v3/automations/deploy.

    Request body:

    This example request body specifies the required parameters as well as a value for an input variable.
    {
      "fileId": 14277,
      "runAsUserIds": [
        2538
      ],
      "botInput": {
        "sDocHello": {
          "type": "STRING",
          "string": "Hello world, go be great."
        }
      }
    }
    This example request body specifies four runAsUserIds and two numOfRunAsUsersToUse. The weighted algorithm selects the two Bot Runners with the least number of tasks queued at the time of the deploy request.
    {
      "fileId": 14277,
      "runAsUserIds": [
        2538,
        4256,
        2213,
        789
      ],
       "poolIds": [
        27
      ],
      "numOfRunAsUsersToUse": 2
    }
    This example request body includes the overrideDefaultDevice set to true, so the bot will be deployed to the device pool instead of the Run-as user's default device. This example also contains the syntax to specify the callback server URL and provide authorization.
    {
      "fileId": 14277,
      "runAsUserIds": [
        245
      ],
       "poolIds": [
        27
      ],
      "overrideDefaultDevice": true,
      "callbackInfo": {
        "url": "https://callbackserver.com/storeBotExecutionStatus",
        "headers": {
          "X-Authorization": "eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiI0Ii"
        }
      }
    }
  3. Send the request.

    Response body:

    When successful, the Bot Deploy API returns a response with the deploymentId.
    {
      "deploymentId": "14c2b6f8-c2a0-4a57-959d-ef413df0d179"
    }
    The REST API responds to each request with an HTTP response code. For response codes, see API response codes.

Next steps

Perform this task: Request bot deployment status API.

Send Feedback