Example of using the simplified REST API to search and update an incident
To retrieve incident details based on search criteria
cURL example
'https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/incident/search?filter=My%20Group%20Tickets' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"limit": 10,
"offset": 10,
"sortBy": [{ "field" : "priority", "order": "desc"}],
"fields": "['\''id'\'','\''status'\'']",
"criteria": {
"bindingExpression": "AND",
"conditions": "{\r\n \"fieldName\": \"status\",\r\n \"operation\": \"eq\",\r\n \"fieldValue\": \"27000\"\r\n },\r\n {\r\n \"fieldName\": \"assignee\",\r\n \"operation\": \"eq\",\r\n \"fieldValue\": \"Allen Allbrook\"\r\n }"
}
}'
Request URL
https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/incident/search?filter=My%20Group%20Tickets
Request body
"limit": 2,
"offset": 0,
"criteria": {
"bindingExpression": "OR",
"conditions": [
{
"fieldName": "status",
"operation": "eq",
"fieldValue": "27000"
},
{
"fieldName": "assignee",
"operation": "eq",
"fieldValue": "Allen Allbrook"
}
]
}
}
To retrieve incident details based on the incident ID
cURL example
-H 'X-Requested-By: XMLHttpRequest' \
-H 'Content-Type: application/json' \
-d '{
"assignee": {
"loginId": "Allen"
},
"assigneeGroupId": "SGP000000000010",
"assigneeGroup": "Frontoffice Support",
"assigneeSupportCompany": "Calbro Services",
"assigneeSupportOrganization": "IT Support"
}'
Request URL
To update the details of an incident
cURL example
'https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/incident/INC000000000102' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
}'
Request URL
https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/incident/INC000000000102
Request body
"fields": [
"id",
"assigneeGroupId",
"assignee",
"assigneeGroup",
"assigneeSupportOrganization",
"assigneeSupportCompany"
],
"assignee": {
"loginId": "Allen"
},
"assigneeGroupId": "SGP000000000010",
"assigneeGroup": "Frontoffice Support",
"assigneeSupportCompany": "Calbro Services",
"assigneeSupportOrganization": "IT Support"
}
The following example demonstrate how to perform the operations by using Postman client.
Before you begin
Make sure that you have a valid authentication token. For more information, see Access-and-authentication-for-the-simplified-REST-API.
To search and update an incident
- Open the Postman - REST Client.
Depending on your goal, set the request URL and method as any of the following:
Goal
Method
Sample URL
To retrieve incident details based on search criteria
POST
https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/incident/search?filter=<search filter>
In this URL, the filter query parameter can have the following three values:
- My Group Tickets
- My Group Open Tickets
- My Group Need Attention Tickets
To retrieve incident details based on the incident ID
GET
https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/incident/INC000000000102
To update the details of an incident
PATCH
https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/incident/INC000000000102
- Click Headers.
Enter the following data as key value pairs in the header:
Key
Value
X-Requested-By
XMLHttpRequest
Content-Type
application/json
- On the Body tab, select raw.
- From the list, select JSON.
Enter the JSON.
For example- Click Send.
The results are displayed on the response panel.