Send on Save
The Send On Save feature in the Service Console sends the incident thread response to the primary contact when an incident thread is created. In the May 2018 release, this functionality has been added to Connect REST API. The incidentResponse object is a wrapper object for the incident and the Send On Save details, including Cc, Bcc, file attachments, and email signature information. Send On Save functionality is called by invoking a POST method on incidentResponse REST resource.
Note:
When the Connect REST API is used to send an incident thread response, it has no effect on already saved responses in the Service Console.This use case discusses these scenarios:
Create an Incident
The following example shows a REST API request that creates an incident along with a thread entry and sends a response.
Use the POST method with the following syntax:
https://your_site_interface/services/rest/connect/version/incidentResponse
Example URL
https://mysite.example.com/services/rest/connect/v1.4/incidentResponse
Example Request
{
"incident": {
"subject": "Problem with my phone",
"primaryContact":
{
"id": 1339
},
"threads": [
{
"text": "Sample thread",
"entryType": {
"id": 1
}
}
]
},
"cc": {
"emailAddresses": ["example@address.com" ]
}
}
Example Response
The status 200 OK is returned, indicating that the incident was created and an email response was sent to the primary contact.
{
"incident": {
"id": 2875,
"lookupName": "180309-000002"
},
"links": [
{
"rel": "self",
"href": "https://mysite.example.com/services/rest/connect/v1.4/incidentResponse"
},
{
"rel": "canonical",
"href": "https://mysite.example.com/services/rest/connect/v1.4/ incidentResponse"
},
{
"rel": "describedby",
"href": "https://mysite.example.com/services/rest/connect/v1.4/metadata-catalog/ incidentResponse",
"mediaType": "application/schema+json"
}
]
}
Update an Incident
The following example shows a REST API request that updates an incident along with a thread entry and sends a response.
Use the POST method with the following syntax:
https://your_site_interface/services/rest/connect/version/incidentResponse
Example URL
https://mysite.example.com/services/rest/connect/v1.4/incidentResponse
Example Request
{
"incident": {
"id": 85,
"threads": [
{
"text": "Sample Text",
"entryType": {
"id": 2
}
}
]
},
"cc": {
"emailAddresses": [ "example@address.com" ]
},
"fileAttachments": [
{
"fileName":"SampleFileAttachment.txt",
"data":"c2FtcGxlIGNvbnRlbnQgZm9yIGZpbGUgYXR0YWNobWVudA=="
}
],
"useEmailSignature" : true
}
Example Response
The status 200 OK is returned, indicating that the incident was updated with a new thread entry and an email response was sent to the email address specified in cc.
{
"incident": {
"id": 85,
"lookupName": "180309-000003"
},
"links": [
{
"rel": "self",
"href": "https://mysite.example.com/services/rest/connect/v1.4/incidentResponse"
},
{
"rel": "canonical",
"href": "https://mysite.example.com/services/rest/connect/v1.4/ incidentResponse"
},
{
"rel": "describedby",
"href": "https://mysite.example.com/services/rest/connect/v1.4/metadata-catalog/ incidentResponse",
"mediaType": "application/schema+json"
}
]
}