Using the Get method
Use the Get method actions from the REST Web Service package to send requests to and receive responses from a REST API.
This example uses endpoints from the Swagger Petstore sample API (https://petstore.swagger.io/) to demonstrate using Get method action to retrieve data from the Petstore database.
Note: GET method action does not take any request body.
Open a new bot:
- On the left panel, click Automation.
- In the Create Task Bot window, enter a bot name. For more information about choosing bot names, see bot naming conventions.
Accept the default folder location \Bots\.
To change where your bot is stored, click Choose and follow the prompts.
- Click Create and edit.
Use the Get method
action to retrieve a list of all the available pets.
Double-click or drag the action.
Enter the following URI:
Under Authentication Mode drop-down, select
No Authentication as this endpoint does not
Note: Typically endpoint requires authentication to ensure that only authorized applications are able to access the data. Select an appropriate authentication mechanism to allow access to the endpoint you want to access.
Create the variable
Outputin the Assign the output to a variable field. For more information on creating a variable, see Create a variable.
- Double-click or drag the action.
Insert a Log to file
action to see the response body.
- Double-click or drag the Log to file action.
- Provide the file path to a text file.
In the Enter text to log field, enter
Click Save and then click
The bot retrieves the response body and saves it to the text file.