閱讀及檢閱 Automation Anywhere 文件

Automation 360

關閉內容

內容

開啟內容

Using PUT method

  • 已更新:2022/04/21
    • Automation 360 v.x
    • 探索
    • RPA 工作區

Using PUT method

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

程序

  1. Use the Put method action to update the pet name to "Pluto" and pet status to "sold".
    1. Double-click or drag the REST Web Services > Put method action.
    2. Enter the following URI:
      https://petstore.swagger.io/v2/pet
    3. Open the log file saved in Using GET method and copy the Pet ID of the first entry.
    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:
      {
        "petId": 0,
         "name": "Pluto",
        "status": "sold"
      }
    5. Insert the variable Output in the Assign the output to a variable field.
  2. Move the Message box action below the Put method action:
    1. Double-click or drag the Message box action.
    2. In the Enter text to log field, enter $Output{Body}$.
  3. Click Save and then click Run.
    The bot retrieves the response body and prints it to the Message box. A successful response includes "name":"Pluto","status":"sold".
傳送意見反饋