Overview of DELETEs
Within the context of APIs that are fully REST-compliant, a DELETE is an endpoint operation that deletes a resource. This typically involves removing the resource from the underlying database.
Within the context of Cloud API, a DELETE is a Cloud API method that "removes" an existing resource from an InsuranceSuite application. What it means to "remove" the resource depends on the resource type. The DELETE operation federates to the InsuranceSuite application code that matches the functionality most closely tied to deletion. That code could theoretically:
- Delete the corresponding data model instance from the operational database.
- Mark the corresponding data model instance as retired.
- Modify the corresponding data model instance and other related instances to indicate the data is no longer active or available.
Unlike GET, POST, and PATCH, there are only a small number of endpoints in the base configuration that support DELETE. This is because, in most cases, InsuranceSuite does not support the removal of data. Several business objects can be approved, canceled, completed, closed, declined, rejected, retired, skipped, or withdrawn. But only a few can be deleted.
A DELETE call consists of the DELETE method and the endpoint, such as DELETE
/notes/{noteId}. Similar to GETs, DELETEs are not permitted to have a
request payload.
The response to a DELETE includes an HTTP code indicating success or failure. DELETE responses do not have a response payload.
Tutorial: DELETE a note
This tutorial assumes you have set up your environment with Postman and the correct sample dataset. For more information, see Tutorial: Set up your Postman environment.
In this tutorial, you will send calls as one of the following users, depending on your InsuranceSuite application:
- ClaimCenter: You will send calls as Elizabeth Lee (user name
elee). In the base configuration, Elizabeth Lee is a manager who has permission to delete notes. As Elizabeth Lee, you will create a note and query for it. You will then delete the note and attempt to query for it a second time. - PolicyCenter: You will send calls as Amy Clinton (user name
aclinton). In the base configuration, Amy Clinton is an underwriting supervisor who has permission to delete notes. As Amy Clinton, you will create a note and query for it. You will then delete the note and attempt to query for it a second time.
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.
- Enter the following call for your respective InsuranceSuite application and click
Send:
- ClaimCenter: GET
http://localhost:8080/cc/rest/common/v1/activities - PolicyCenter: GET
http://localhost:8180/pc/rest/common/v1/activities?filter=subject:sw:Review%20riskThe sample data includes one "Review risk information" activity for Alice Applegate. The call queries for that activity.
- ClaimCenter: GET
- Identify the
idof the activity in the payload (the first activity in ClaimCenter). This value is referenced below as <activityId>. - Open a second request tab. Right-click the first tab and select Duplicate Tab.
- On the Authorization tab, select Basic Auth using user elee for ClaimCenter or aclinton for PolicyCenter and password gw.
- Change the operation to POST and enter the following URL for your respective
InsuranceSuite application, but do not click Send yet:
- ClaimCenter: POST
http://localhost:8080/cc/rest/common/v1/activities/<activityId>/notes - PolicyCenter: POST
http://localhost:8180/pc/rest/common/v1/activities/<activityId>/notes
- ClaimCenter: POST
- 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.
{ "data": { "attributes": { "body": "API tutorial note to be deleted" } } }
- Click Send. In the response payload, identify the note's id.
- Open a third request tab. Right-click the second tab and select Duplicate Tab.
- On the Authorization tab, select Basic Auth using user elee for ClaimCenter or aclinton for PolicyCenter and password gw.
- Change the operation to DELETE and enter the following URL for your respective
InsuranceSuite application, but do not click Send yet:
- ClaimCenter: DELETE
http://localhost:8080/cc/rest/common/v1/notes/<noteID> - PolicyCenter: DELETE
http://localhost:8180/pc/rest/common/v1/notes/<noteID>
- ClaimCenter: DELETE
- DELETEs cannot specify request bodies. On the third tab, navigate to the Body tab and select the none radio button.
- Click Send. (The response to a successful DELETE is "204 - No content".)
Checking your work
Resend the request on the third tab. This request returns a "No resource was found" error because it is attempting to DELETE a note that has already been DELETEd.
Tutorial: DELETE an account contact
This tutorial assumes you have set up your environment with Postman and the correct sample dataset. For more information, see Tutorial: Set up your Postman environment.
In this tutorial, you will delete the primary contact on the Standard Account.
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 su and password gw.
- Enter the following call and click Send:
GET
http://localhost:8580/bc/rest/billing/v1/accounts?filter=accountNumber:eq:Standard%20Account - Identify the
idof the account that is returned. This value is referenced below as <accountId>. - Open a second request tab and right-clicking the first tab and selecting Duplicate Tab.
- On the Authorization tab, select Basic Auth using user su and password gw.
- Enter the following URL:
GET
http://localhost:8580/bc/rest/billing/v1/accounts/<accountId>/contacts - Click Send. In the response payload, there is one contact: Bill Baker. Identify the contact's id, referenced below as <contactId>.
- Open a third request tab by right-clicking the second tab and selecting Duplicate Tab.
- Change the operation to DELETE and enter the following URL:
DELETE
http://localhost:8080/bc/rest/billing/v1/accounts/<accountId>/contacts/<contactId> - Click Send. (The response to a successful DELETE is "204 - No content".)
Checking your work
Resend the request on the third tab. This request returns a "No resource was found" error because it is attempting to DELETE a note that has already been DELETEd.
This removes the contact from the account. The contact still exists in the database, but the contact is no longer associated with the account.