Create the essential API Tasks for your automation, utilizing the
readily available packages within the API Task editor.
Before you begin
You must have a Bot Creator license.
About this task
This topic describes the first step of crafting the API and Bot Tasks that will orchestrate
the automation process. In this example, let us consider a sending a "Hello World"
message using an API Task to Microsoft Teams.
Procedure
-
Log in to your instance of the Automation Anywhere Control Room as a Bot
creator.
-
Create a new API Task:
-
From the left pane, click Automation.
-
Click .
-
In the Create API Task window, enter the API Task name.
-
Accept the default folder location: \Bots\.
To change where your API Task is stored, click
Choose and follow the prompts.
-
Click Create & edit.
In this example, an API Task is created that calls an API to send a "Hello
World" message on Teams.
-
Use the Post method
action to send a message in Teams.
Note: Pre-built packages are available for most common
enterprise applications. For a list of supported packages, see
Table 1.
-
Double-click or drag the
action.
-
You can use the Graph API to send a chat message on Teams. For more
information, see https://learn.microsoft.com/en-us/graph/api/chat-post-messages.
Note:
You can call multiple APIs within a single API Task. This can simplify your automation and reduce the need for
multiple separate tasks. For instance, you can call API 1 to
fetch product data, API 2 to fetch pricing data, and then API 3
to create a quotation within the same API Task.
-
In the Authentication Mode drop-down list,
select No Authentication and click Add
header to input the bearer token. In this example, the
bearer token is stored in a variable
(in_graph_bearertoken).
Note: Typically, endpoints require authentication to ensure that only
authorized applications can access the data. Select an appropriate
authentication mechanism to allow access to the endpoint you want to
access.
-
Under Content type, make sure
JSON
(application/json) is selected and enter the following JSON
in Custom parameters.
{
"body": {
"content": "Hello World"
}
}
-
Assign the output of the API to a variable (o_teams).