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
- In Postman, start a new request by clicking the + to the right of the Launchpad tab.
-
Specify Basic Auth authorization using user
aapplegate
and passwordgw
. - Under the Untitled Request label, select PATCH.
-
In the Enter request URL field, enter the URL for the server and
the endpoint.
- For example, to patch role
billing_manager
on an instance of BillingCenter on your machine, enter:http://localhost:8580/bc/rest/admin/v1/roles/billing_manager
- For example, to patch role
-
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.
- Click Send. The response payload appears below the request payload.
Tutorial: PATCH an account
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
- In Postman, start a new request by clicking the + to the right of the
Launchpad tab.
- On the Authorization tab, select Basic Auth using user aapplegate and password gw.
- The sample data includes one sample account called "Standard Account." Query for
that account by entering the following call and clicking
Send:
- GET
http://localhost:8180/bc/rest/billing/v1/accounts?filter=accountNumber:eq:Standard%20Account
- GET
- For the account in the response payload, note the following information:
- The account ID (
id
) - The account name (
accountName
)
- The account ID (
- Open a second request tab and right-clicking the first tab and selecting Duplicate Tab.
- Change the operation to PATCH and enter the following URL, but do not click
Send yet:
- PATCH
http://localhost:8180/bc/rest/billing/v1/accounts/<accountID>
- PATCH
- 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 following into the text field underneath the radio buttons.
- Click Send. The response payload appears below the request payload.
Checking your work
- View the modified activity in BillingCenter.
- Log into BillingCenter as the user
aapplegate
. Click on the Account tab. Search for "Standard Account" in the Account # field, and select the account.
- Log into BillingCenter as the user
The PATCHed account now has the name "Updated Standard Account."