Skip to main content
Cadet | Tier 2
March 21, 2022
Solved

How do I pass list, dictionary or datetime type variables as input to the Deploy Bot API?

  • March 21, 2022
  • 13 replies
  • 1325 views

Hi,

 

I'm trying to deploy bots with input parameters using Automation Anywhere API. I've successfully managed to pass string, number and boolean variables to the bot, but I can't seem to figure out what is the correct json syntax to pass dictionaries, list or datetime variables. I've looked for it in the swagger (https://dev-damantia.my.automationanywhere.digital/swagger/) but can't find information about it

 

I'm using the Postman collection provided by @MICAH SMITH​  in this video https://youtu.be/UZJ68r64oxA

 

Here is what I'v tried so far:

-List:

{

  "fileId": *****, //id of the bot to execute

  "runAsUserIds": [

    *** //id(s) of the user account to run the bot - must have default device unless specified below

  ],

  "poolIds": [],

  "overrideDefaultDevice": false,

  "callbackInfo": {

    "url": "https://callbackserver.com/storeBotExecutionStatus", //Callback URL - not required, but can be used - can be removed if no callback needed

    "headers": {

      "X-Authorization": "{{token}}" //Callback API headers. Headers may contain authentication token, content type etc. Both key & value are of type string.

    }

  },

  "BotInput": { //optional values to map to the bot...NOTE: These values must match the exact variable names and must be defined as input values

    "lInput1": {

      "type": "LIST", //Type can be [ STRING, NUMBER, BOOLEAN, LIST, DICTIONARY, DATETIME ]

      "list": ["Value11","Value12"] //key must match type, in this case string

    },

    "lInput2": {

      "type": "LIST",

      "list": ["Value21","Value22"] //key must match type, in this case string

    }

  }

 

-Dictionary:

{

  "fileId": ******, //id of the bot to execute

  "runAsUserIds": [

    *** //id(s) of the user account to run the bot - must have default device unless specified below

  ],

  "poolIds": [],

  "overrideDefaultDevice": false,

  "callbackInfo": {

    "url": "https://callbackserver.com/storeBotExecutionStatus", //Callback URL - not required, but can be used - can be removed if no callback needed

    "headers": {

      "X-Authorization": "{{token}}" //Callback API headers. Headers may contain authentication token, content type etc. Both key & value are of type string.

    }

  },

  "BotInput": { //optional values to map to the bot...NOTE: These values must match the exact variable names and must be defined as input values

    "dInput1": {

      "type": "DICTIONARY", //Type can be [ STRING, NUMBER, BOOLEAN, LIST, DICTIONARY, DATETIME ]

      "dictionary": [{"Key1":"Value1"}] //key must match type, in this case string

    },

    "dInput2": {

      "type": "DICTIONARY",

      "dictionary": [{"Key2":"Value2"}] //key must match type, in this case string

    }

  }

}

 

-Datetime:

 

{

  "fileId": *******, //id of the bot to execute

  "runAsUserIds": [

    *** //id(s) of the user account to run the bot - must have default device unless specified below

  ],

  "poolIds": [],

  "overrideDefaultDevice": false,

  "callbackInfo": {

    "url": "https://callbackserver.com/storeBotExecutionStatus", //Callback URL - not required, but can be used - can be removed if no callback needed

    "headers": {

      "X-Authorization": "{{token}}" //Callback API headers. Headers may contain authentication token, content type etc. Both key & value are of type string.

    }

  },

  "BotInput": { //optional values to map to the bot...NOTE: These values must match the exact variable names and must be defined as input values

    "dtInput1": {

      "type": "DATETIME", //Type can be [ STRING, NUMBER, BOOLEAN, LIST, DICTIONARY, DATETIME ]

      "datetime": "03/02/1999" //key must match type, in this case string

    },

    "dtInput2": {

      "type": "DATETIME",

      "datetime": "03/05/1999" //key must match type, in this case string

    }

  }

}

 

With all these API requests the bot is being deployed, but it is receiving empty variables. What should be the correct json syntax for these data types?

 

Thank you

This topic has been closed for replies.
Best answer by Sumit.K7

@Eduardo Martínez Hernández​ Refer below sample:

"botInput": {

        "dict_input": {

            "type": "DICTIONARY",

            "dictionary": [

                {

                    "key": "key1",

                    "value": {

                        "type": "STRING",

                        "string": "value1"

                    }

                },

                {

                    "key": "key2",

                    "value": {

                        "type": "STRING",

                        "string": "value2"

                    }

                }

            ]

        },

        "list_input": {

            "type": "LIST",

            "list": [

                {

                    "type": "NUMBER",

                    "number": "123"

                },

                {

                    "type": "STRING",

                    "string": "liststring"

                }

            ]

        },

        "dt_input": {

            "type": "DATETIME",

            "string": "2022-03-22T00:15:00+05:30[Asia/Calcutta]"

        }

    }

13 replies

Theodore Xypteras
Navigator | Tier 3
March 12, 2025
Theodore Xypteras
Navigator | Tier 3
March 12, 2025

Does anyone know how to pass value to a credential variable?

according to the v4 deploy swagger reference, you need to pass a credential vault reference instead of the credential itself: 

CredentialObject{

name string
lockerName string
attributeName string

}

I have a cunning plan!
Shreya.Kumar
Pathfinder Community Team
March 17, 2025

Closing this topic as we have solved the initial query about  list, dictionary or datetime type variables. Please feel free to start new topics if you need help.