Sending POSTs

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

Send a POST 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 POST is selected.
  4. In the Enter request URL field, enter the URL for the server and the endpoint.
    • For example, to create a new note for activity cc:2 on an instance of ClaimCenter on your machine, enter: http://localhost:8080/cc/rest/common/v1/activities/cc:2/notes
  5. 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 request payload into the text field underneath the radio buttons.
  6. Click Send. The response payload appears below the request payload.

Tutorial: Create a new note that specifies required fields only

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 create a note whose subject is "API tutorial note 1" for an existing activity. The other fields will not be specified and will be assigned default values by the application (such as not being confidential and having a subject of "General").

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. Enter the following call and click Send:

    GET http://localhost:8080/cc/rest/common/v1/activities

  3. Identify the id of the first activity in the payload. This value is referenced below as <activityId>.
  4. Open a second request tab and right-clicking the first tab and selecting Duplicate Tab.
  5. Change the operation to POST and enter the following URL, but do not click Send yet:

    POST http://localhost:8080/cc/rest/common/v1/activities/<activityId>/notes

  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.
      {
          "data":
              {
                  "attributes": {
                      "body": "API tutorial note 1"
                      }
              }
      }
  7. Click Send. The response payload appears below the request payload.

Checking your work

  1. View the new note in ClaimCenter.
    1. In the response payload, note the claim number of the claim this note is related to. (It is the value of the relatedTo.displayName field.)
    2. Log on to ClaimCenter as aapplegate.
    3. On the Claim tab, click the drop-down arrow. Enter the claim number in the Claim # field and press Enter.
    4. In the left-hand sidebar, click Notes.

The API tutorial note should be listed as one of the notes.

Tutorial: Create a new note that specifies optional fields

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 create a note whose subject is "API tutorial note 2" for an existing activity. You will also specify values for two optional fields: confidential (set to true) and subject (set to "Litigation").

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. Enter the following call and click Send:

    GET http://localhost:8080/cc/rest/common/v1/activities

  3. Identify the id of the first activity in the payload. This value is referenced below as <activityId>.
  4. Open a second request tab and right-clicking the first tab and selecting Duplicate Tab.
  5. Change the operation to POST and enter the following URL, but do not click Send yet:

    POST http://localhost:8080/cc/rest/common/v1/activities/<activityId>/notes

  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.
      {
          "data":
              {
                  "attributes": {
                      "body": "API tutorial note 2",
                      "confidential": true,
                      "topic": {
                          "code": "litigation"
                      }
                  }
              }
      }
  7. Click Send. The response payload appears below the request payload.

Checking your work

  1. View the new note in ClaimCenter.
    1. In the response payload, note the claim number of the claim this note is related to. (It is the value of the relatedTo.displayName field.)
    2. Log on to ClaimCenter as aapplegate.
    3. On the Claim tab, click the drop-down arrow. Enter the claim number in the Claim # field and press Enter.
    4. In the left-hand sidebar, click Notes.

The API tutorial note should be listed as one of the notes. This note is confidential and it has the category specified in the request payload.