Using the Get method

Use the Get method actions from the REST Web Service package to retrieve or get the information identified by parameters included in the URI .

This example uses endpoints from the Swagger Petstore sample API (Petstore) to demonstrate using Get method action to retrieve data from the Petstore database.
Note: GET method action does not take any request body.

Procedure

  1. Create a new bot.
    1. Log in to your instance of the Control Room.
    2. On the left panel, click Automation.
    3. Click Create new > Bot.
    4. In the Create Task Bot window, enter the bot name.
    5. Accept the default folder location: \Bots\
      To change the default bot storage location, click Choose and follow the prompts.
    6. Click Create and edit.
  2. Use the Get method action to retrieve a list of all the available pets.
    1. Double-click or drag the REST Web Services > Get method action.
      Rest Web Services - Get method
    2. Enter the following URI:
      https://petstore3.swagger.io/api/v3/pet/findByStatus?status=available
    3. Under Authentication Mode drop-down, select No Authentication as this endpoint does not require authentication.
      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.
    4. Create the variable Output in the Assign the output to a variable field. For more information on creating a variable, see Create a variable.
  3. Insert a Log to file action to see the response body.
    1. Double-click or drag the Log to file action.
    2. Provide the file path to a text file.
    3. In the Enter text to log field, enter $Output{Body}$.
  4. Click Save and then click Run.
    The bot retrieves the response body and saves it to the text file.
    Note: You cannot use the download API endpoints to download an exported bot or file in the REST Web Service package.