Using the Put method

Use the Put method actions from the REST Web Service package to update or replace existing resource.

This example uses endpoints from the Swagger Petstore sample API (Petstore) to demonstrate using Put method action to update data to the Petstore database.

Procedure

  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 the 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".