Leia e revise a documentação do Automation Anywhere

Automation 360

Fechar conteúdo

Contents (Conteúdo)

Abrir conteúdo

Using POST method

  • Atualizado: 2022/04/20
    • Automation 360 v.x
    • Explorar
    • Espaço de trabalho RPA

Using POST method

Use the Post 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 Post method action to add data to the Petstore database.

Procedimento

  1. Abra um novo bot:
    1. Na interface Web do Automation Anywhere Enterprise, selecione Bots > Meus bots.
    2. Clique em Criar TaskBot.
    3. Insira o nome do bot.
    4. Aceite o local da pasta padrão \Bots\.
      Para alterar o local de armazenamento do bot, clique em Escolher e siga as instruções.
    5. Clique em Criar e editar.
  2. Use the Post method action to add a new pet to the store.
    1. Double-click or drag the REST Web Services > Post method action.

    2. Enter the following URI:
      https://petstore.swagger.io/v2/store/order
    3. Under Authentication Mode drop-down, select No Authentication as this endpoint does not require authentication.
      Nota: 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. Copy and paste the following into the Custom parameters field, replacing the text in the angle brackets with the value that you copied from the file:
      {
        "id": 0,
        "petId": 0,
        "quantity": 0,
        "shipDate": "2022-04-20T22:08:11.977Z",
        "status": "placed",
        "complete": true
      }
    5. Create the variable Output in the Assign the output to a variable field. For more information on creating a variable, see Criar uma variável.
  3. Insert a Message box action to see the response body.
    1. Double-click or drag the Log to file action.
    2. In the Enter the message to display field, enter $Output{Body}$.
  4. Click Save and then click Run.
    The bot displays the response in the message box.
Send Feedback (Enviar Feedback)