Example of using the simplified REST API to create a ticket
To create an incident
cURL example
'https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/incident' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"summary": "Printer is not working",
"impact": 2000,
"priority": 2,
"urgency": 4000,
"incidentType": 0,
"assigneeGroupId": "SGP000000000010",
"assigneeGroup": "Frontoffice Support",
"assigneeSupportCompany": "Calbro Services",
"assigneeSupportOrganization": "IT Support",
"customer": {
"loginId": "Allen"
}
}'
Request URL
Request Body
"summary": "Printer is not working",
"impact": 2000,
"priority": 2,
"urgency": 4000,
"incidentType": 0,
"assigneeGroupId": "SGP000000000010",
"assigneeGroup": "Frontoffice Support",
"assigneeSupportCompany": "Calbro Services",
"assigneeSupportOrganization": "IT Support",
"customer": {
"loginId": "Allen"
}
}
To create a problem
cURL example
curl --location --request POST '<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/problem' \
--header 'X-Requested-By: XMLHttpRequest' \
--header 'Content-Type: application/json' \
--data-raw '{
"summary": "Sample problem is created",
"description": "This is sample problem to test create problem api",
"impact": 4000,
"urgency": 4000,
"siteId": "STE_SOLN0002846",
"site": "Headquarters, Building 1.31",
"siteGroup": "United States",
"siteRegion": "Americas",
"company": "Calbro Services"
}'
Request URL
https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/problem
Request body
{
"summary": "Sample problem is created",
"description": "This is sample problem to test create problem api",
"impact": 4000,
"urgency": 4000,
"siteId": "STE_SOLN0002846",
"site": "Headquarters, Building 1.31",
"siteGroup": "United States",
"siteRegion": "Americas",
"company": "Calbro Services"
}
To create a change
cURL example
--header 'X-Requested-By: XMLHttpRequest' \
--header 'Content-Type: application/json' \
--data-raw '{
"summary": "Change the printer",
"impact": 4000,
"urgency": 1000,
"status": 1,
"locationCompany": "Petramco",
"requestedFor": {
"loginId": "PetramcoAllTicketMaster"
},
"coordinatorGroupId": "SGP000000000213",
"coordinatorGroup": "Petramco Support Group1",
"coordinatorGroupOrganization": "Petramco Support Org1",
"coordinatorGroupCompany": "Petramco"
}'
Request URL
Request body
"summary": "RFA Status From RestAPI1",
"impact": 4000,
"urgency": 1000,
"status": 1,
"locationCompany": "Petramco",
"requestedFor": {
"loginId": "PetramcoAllTicketMaster"
},
"changeManagerGroup": "Petramco Support Group1",
"changeManagerGroupOrganization": "Petramco Support Org1",
"changeManagerGroupCompany": "Petramco",
"coordinator": {
"loginId": "PetramcoCMManager"
},
"coordinatorGroupId": "SGP000000000213",
"coordinatorGroup": "Petramco Support Group1",
"coordinatorGroupOrganization": "Petramco Support Org1",
"coordinatorGroupCompany": "Petramco"
}
The following example demonstrate how to perform the operation 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 create an incident by using the simplified REST API in the Postman client
- Open the Postman REST Client.
- Set the request URL as:
https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/incident - Select the operation as POST.
- Click Headers.
Enter the following data as key value pairs in the header:
Key
Value
X-Requested-By
XMLHttpRequest
Content-Type
application/json
- Select raw.
- From the list, select JSON.
Enter the JSON input for creating a incident.
For example:"{
""fields"": [
""summary"",
""impact"",
""priority"",
""urgency"",
""incidentType"",
""customer"",
""assignee"",
""assigneeGroup"",
""assigneeGroupId"",
""assigneeSupportOrganization"",
""assigneeSupportCompany""
],
""summary"": ""Printer is not working"",
""impact"": 2000,
""priority"": 2,
""urgency"": 4000,
""incidentType"": 0,
""assigneeGroupId"": ""SGP000000000010"",
""assigneeGroup"": ""Frontoffice Support"",
""assigneeSupportCompany"": ""Calbro Services"",
""assigneeSupportOrganization"": ""IT Support"",
""customer"": {
""loginId"": ""Allen""
}
}"You can customize the create criteria by using either AND or OR in bindingExpression.
- Click Send.
The results are displayed on the response panel.