Sending PATCHes

You can use a request tool, such as Postman, to ensure PATCHes are well-formed and to review the structure of the response payloads. For more information on Postman, see Requests and responses.

Send a PATCH using Postman

Procedure

  1. In Postman, start a new request by clicking the + to the right of the Launchpad tab.
  2. Specify Basic Auth authorization using user aapplegate and password gw.
  3. Under the Untitled Request label, make sure that PATCH is selected.
  4. In the Enter request URL field, enter the URL for the server and the endpoint.
    • For example, to patch activity cc:2 on an instance of ClaimCenter on your machine, enter: http://localhost:8080/cc/rest/common/v1/activities/cc:2
  5. Specify the request payload.
    • In the first row of tabs (the one that starts with Params), click Body.
    • In the row of radio buttons, select raw.
    • At the end of the row of radio buttons, change the drop-down list value from Text to JSON.
    • Paste the request payload into the text field underneath the radio buttons.
  6. Click Send. The response payload appears below the request payload.

Tutorial: PATCH an activity

This tutorial assumes you have set up your environment with Postman and the correct sample data set. For more information, see Tutorial: Set up your Postman environment.

In this tutorial, you will find an open activity from the sample data. You will then update the activity's subject and priority.

Tutorial steps

  1. In Postman, start a new request by clicking the + to the right of the Launchpad tab.
    1. On the Authorization tab, select Basic Auth using user aapplegate and password gw.
  2. The sample data includes one "Get police report" activity for Andy Applegate, which can be PATCHed because it is an open activity on an open claim. Query for that activity by entering the following call and clicking Send:
    1. GET http://localhost:8080/cc/rest/common/v1/activities?filter=subject:sw:Get%20police%20report
  3. For the activity in the response payload that is assigned to Andy/Alice Applegate, note the following information:
    1. Activity ID
    2. Priority
    3. Subject
  4. Open a second request tab and right-clicking the first tab and selecting Duplicate Tab.
  5. Change the operation to PATCH and enter the following URL, but do not click Send yet:
    1. PATCH http://localhost:8080/cc/rest/common/v1/activities/<activityID>
  6. Specify the request payload.
    1. In the first row of tabs (the one that starts with Params), click Body.
    2. In the row of radio buttons, select raw.
    3. At the end of the row of radio buttons, change the drop-down list value from Text to JSON.
    4. Paste the following into the text field underneath the radio buttons. Note that the subject has an additional "!" at the end.
      {
        "data": {
          "attributes": {
            "subject" : "Get police report!",
            "priority": {
              "code": "low"
              }
          }
        }
      }
  7. Click Send. The response payload appears below the request payload.

Checking your work

  1. View the modified activity in ClaimCenter.
    1. Log on to ClaimCenter as the user aapplegate. Andy's landing page is the Activities screen, which shows the open activities assigned to him. It defaults to showing "My activities today". change the drop-down list at the top of the Activities screen to "All open".
    2. Click the Priority column to sort the activities in ascending priority order.

The PATCHed activity (whose priority is now Low) should be at or near the top of the list. The patched activity will have a subject ending with an "!".