Add comments to an incident
post
/fleetMonitoring/clientapi/v2/incidents/{incident-id}/comments
This operation adds a comment to an incident that is specified by its ID.
Request
Supported Media Types
- application/json
Path Parameters
-
incident-id: string
ID of the incident to be commented.
Query Parameters
-
expand(optional): string
List of fields to be expanded in the result. Use 'all' to expand all expandable fields in result.
-
fields(optional): string
The comma-separated list of fields to be shown in response. By default all response object fields will be present.
Response
Supported Media Types
- application/json
- application/vnd.oracle.resource+json;type=singular
201 Response
Successfully processed.
Root Schema : IncidentComment_receive
Type:
Show Source
object
-
createdBy:
string
Author of Incident comment
-
createdTime:
integer
Date of Incident comment
-
links:
array links
The set of API navigation links.
-
state:
string
State of Incident comment
-
text:
string
Text of Incident comment
-
type:
string
Type of Incident comment, Type one of [USER_DEFINED, LIFECYCLE_STATE_TRANSITION]
Nested Schema : items
Type:
Show Source
object
-
href:
string
The target resource URIExample:
https://iotserver/iot/api/vX/some/API/path
-
rel:
string
Relation typeExample:
canonical
401 Response
Unauthorized. The request requires user authentication.
404 Response
Not Found. The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.
406 Response
Not Acceptable. The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request.
415 Response
Unsupported Media Type. The request entity has a media type which the server or resource does not support.
Examples
curl -X POST
-u <username>:<password>
-H 'Accept: application/json'
-H 'Content-Type: application/json'
https://iotserver/fleetMonitoring/clientapi/v2/incidents/{incident-id}/comments
Example of Request Body
The following example shows the content of the request body in JSON format:
{
"text":"Text of Incident comment"
}
Example of Response Body
The following example shows the content of the response body in JSON format:
{
"id":"AQ",
"type":"WARNING",
"state":"NEW",
"summary":"summary text",
"description":"description text",
"tags":[ ],
"rule":"",
"priority":"HIGH",
"incidentTime":1493983758314,
"incidentTimeAsString":"2017-05-05T11:29:18Z",
"geoLocation":"12.943208068373247,77.69183921744116",
"createdBy":"system",
"createdTime":1493983758573,
"createdTimeAsString":"2017-05-05T11:29:18Z",
"lastModifiedBy":"system",
"lastModifiedTime":1493983787155,
"lastModifiedTimeAsString":"2017-05-05T11:29:47Z",
"comments":[
{
"type":"USER_DEFINED",
"text":"test comment",
"createdBy":"iot",
"createdTime":1493983787154
}
],
"contextInformation":{
"affectedObjects":[
{
"id":"27ECD42E-338F-49F2-9580-F7A5E3542EF2",
"type":"DRIVER",
"name":"IotFMDriver6",
"currentTrip":"54CBAC60-B5BC-4B6E-BDE2-BAD3A30214CA"
}
],
"occurrences":[
{
"time":1493983758314,
"satisfiedPredicates":[
{
"type":"THRESHOLD",
"information":{
"messageFormatURN":"urn:com:oracle:iot:device:obd2:SFT:attributes",
"attributeName":"ora_obd2_vehicle_speed",
"thresholdValue":"31.0685595",
"operator":"GT",
"observedValue":"62.137119"
}
}
]
}
]
},
"links":[
{
"href":"https://iotserver/fleetMonitoring/clientapi/version/resource/path",
"rel":"self"
},
{
"href":"https://iotserver/fleetMonitoring/clientapi/version/resource/path",
"rel":"canonical"
}
]
}
Complete cURL Example
The following example shows the complete cURL command that can be used to perform the described operation:
curl -X POST
-u <username>:<password>
-H 'Accept: application/json'
-H 'Content-Type: application/json'
-d '{"text":"Text of Incident comment"}'
https://iotserver/fleetMonitoring/clientapi/v2/incidents/461a33535f28-3b05/comments
Note that in the request,
https://iotserver
will be replaced by the name and port of your assigned IoT Cloud Service instance. The format of the Cloud Service instance is
https://myinstance-myidentitydomain.iot.us.oraclecloud.com
and the default port is
443
.