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
Path Parameters
Query Parameters
  • List of fields to be expanded in the result. Use 'all' to expand all expandable fields in result.
  • The comma-separated list of fields to be shown in response. By default all response object fields will be present.
Header Parameters
  • To allow targeting requests to different organizations. The header value should contain the organization identifier(orgId). This header is optional, if not provided orgId will be ORA_DEFAULT_ORG
Body ()
Root Schema : IncidentComment_create
Type: object
Show Source
Back to Top

Response

Supported Media Types

201 Response

Successfully processed.
Body ()
Root Schema : IncidentComment_receive
Type: object
Show Source

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.
Back to Top

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.
Back to Top