Example of using the simplified REST API to retrieve and update work notes
To retrieve the details of a work note from a ticket
cURL example
'https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/worknote/incident/INC000000000102' \
-H 'accept: application/json'
Request URL
Response body
""status"": ""Success"",
""recordCount"": 1,
""details"": [
{
""note"": ""Adding image"",
""submitter"": ""Allen"",
""attachments"": [
{
""fileName"": ""icn_rewards.png"",
""fileSize"": 1141,
""downloadUrl"": ""api/com.bmc.dsm.itsm.itsm-rest-api/attachment/download/HPD:WorkLog/1000000351/AGGAA5V0FMHNBAR406EMR406EMLQ1S"",
""id"": ""AGGAA5V0FMHNBAR406EMR406EMLQ1S"",
""attachmentReference"": {
""dataSourceId"": ""AGGAA5V0FMHNBAR406EMR406EMLQ1S"",
""attachmentFieldId"": ""1000000351"",
""dataSource"": ""HPD:WorkLog""
}
}
],
""attachmentCount"": 1,
""id"": ""AGGAA5V0FMHNBAR406EMR406EMLQ1S"",
""type"": ""8000"",
""activityType"": ""user"",
""viewAccess"": false,
""createDate"": ""2022-06-30T11:33:58.000Z""
}
]
}"
To add a work note to a ticket
cURL example
curl --location --request POST 'http://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/worknote/incident/INCI000000000010' \
--header 'X-Requested-By: XMLHttpRequest' \
--form 'file=@"/Users/Allen/Logs/LogFile.txt"' \
--form 'note="This is sample note with attachment"' \
--form 'infoType="4000"' \
--form 'access="true"'
Request URL
Response body
"status": "Success",
"details": {
"id": "AGGAA5V0FMHNBAR492L4R492L4WXLG"
}
}
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 a problem investigation
- 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 the details of a work note from a ticket
GET
https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/worknote/<type>/<ID>?startIndex=<StartIndex>&pageSize=<pageSize>
To add a work note to a ticket
POST
https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/worknote/<type>/<ID>
The following are the parameters:
Parameter
Type
Description
Type
String
Specify any of the following ticket types:
- Incident
- Problem
- Change
ID
String
The ID of the ticket. For example: INC000000000102.
startIndex
Integer
This is an optional parameter to specify the start index.
pageSize
Integer
This is an optional parameter to specify the page size for the result.
- Click Headers.
Enter the following data as key value pairs in the header:
Key
Value
X-Requested-By
XMLHttpRequest
Content-Type
application/json
- Perform the following steps only if you want to add a work note to a ticket:
- On the Body tab, select form-data.
- You can use files to provide additional information for the problem investigation.
- Click Send.
The results are displayed on the response panel.