Sinch Contact Center Restful Contact Management Interface (CMI) version v1
http://localhost:8080/RI/cmi
Description
This interface provides data of contacts and their content.
Request Header Data Requirements
To GET JSON response, the request must have "Accept = application/json" header.
To GET XML response, the request should have "Accept = application/xml" header.
To POST/PUT JSON data, the request must have "Content-Type = application/json" header.
To POST/PUT XML data, the request should have "Content-Type = application/xml" header.
POST should also have "Accept = text/html" header. It returns the ID of the created object. POST also returns Location header which contains the ID. POST returns code 201 (Created).
PUT and DELETE do not have any response, instead they return code 204 (No Content).
/emails
Collection of emails.
Get a list of emails.
get /emails
Get a list of emails.
Query Parameters
- language: (string)
Define with a two-character code (ISO 639) the language to which the translatable values are translated. By default, logged-on user’s language is used.
Example:
language=FI
- case_id: (string)
Search emails filtered by "case id"
Example:
case_id=21180
- cid: (string)
Search emails filtered by "cid"
Example:
cid=CID44DB84A95D1A
- limit: (integer - default: <
>) Limit number of elements by specifying a limit value for the query
Example:
limit=20
HTTP status code 200
Body
Media type: application/json
Type: array of object
Items: emails
- id: required(string - minLength: 32 - maxLength: 32)
- from_queue: required(object)
- id: required(string - minLength: 32 - maxLength: 32)
- name: required(string)
- channel_type: required(string)
- channel_sub_type: required(string)
- type: required(one of EmailIn, EmailOut)
- typeDetails: required(string)
Operative database has the following email types: ACTION, EMAIL, EMAILOUT, TASK, OII_EMAIL, XRI
- status: required(string)
- statusDetails: required(string)
Operative database has the following statuses: Deleted, Handled, Closed, Pending, Sent, Open, Forwarded
- case_id: (string)
- cid: (string)
- title: required(string)
Email subject.
- content: required(string)
Email body.
- remarks: (string)
Email remarks.
- attachments: (array of AttachmentInfo)
Items: AttachmentInfo
- id: required(string - minLength: 32 - maxLength: 32)
- filename: required(string)
- mime_type: required(string)
- size: required(number)
- originator: required(one of customer, agent)
- originator: required(string)
Source email address.
- destination: required(string)
Email address.
- from_address: required(object)
- name: required(string)
- address: required(string)
- to_address: required(array of EmailAddress)
Items: EmailAddress
- name: required(string)
- address: required(string)
- cc_address: (array of EmailAddress)
Items: EmailAddress
- name: required(string)
- address: required(string)
- bcc_address: (array of EmailAddress)
Items: EmailAddress
- name: required(string)
- address: required(string)
- agentId: (string - minLength: 32 - maxLength: 32)
The agent who is handling or who has handled this contact. Null value not returned - there is no agent.
- agentName: (string)
- date_created: required(datetime)
ISO-8601 UTC timestamp in format 2011-12-31T13:15:30.123Z
Example:
[
{
"attachments": [
{
"size": 440721,
"filename": "Help.pdf",
"id": "064C7F3C69A64566A0D661ADB0DC0153",
"mime_type": "application/pdf"
},
{
"size": 440,
"filename": "Notes.txt",
"id": "68F94FB8567748869A7D873DAEF46B1B",
"mime_type": "text/plain"
},
{
"size": 88252,
"filename": "Picture_small.jpg",
"id": "5236C1E666554638A837CC3408A45614",
"mime_type": "image/jpeg"
}
],
"case_id": "68108",
"cc_address": [
{
"address": "Jack@bcmtr.bcm.corp",
"name": "Jonhnson, Jack"
}
],
"channel_sub_type": "inbound",
"channel_type": "email",
"cid": "CID0DCB56DFCC80",
"content": "<p>Hey,</p> <p>I would like to order excellent Sinch RI application for our system. </p> <p>Note: No matter how much it will cost!</p> <p>Br : Happy Customer / Mr. Boss</p> ",
"date_created": "2017-02-23T11:49:09.340Z",
"destination": "sales@bcmtr.bcm.corp",
"from_address": {
"address": "Mr.Boss@Big.Company.corp"
},
"from_queue": {
"id": "97C9F85A2F55484198FD908C6A97FA7D",
"name": "Direct Sales"
},
"id": "50753BBE49774211AC8286DBCBE17741",
"originator": "Mr.Boss@Big.Company.corp",
"status": "handled",
"title": "Sinch CCtr RI order",
"to_address": [
{
"address": "Mr.Boss@Big.Company.corp"
}
]
},
{
"attachments": [
{
"size": 440721,
"filename": "Offer.pdf",
"id": "AA4C7F3C69A64566A0D661ADB0DC0153",
"mime_type": "application/pdf"
},
{
"size": 99440,
"filename": "OfferDetails.xls",
"id": "AAF94FB8567748869A7D873DAEF46B1B",
"mime_type": "application/excel"
},
{
"size": 88252,
"filename": "Info.doc",
"id": "AA36C1E666554638A837CC3408A45614",
"mime_type": "application/msword"
}
],
"case_id": "10512",
"cc_address": [
{
"address": "Jack@bcmtr.bcm.corp",
"name": "Jonhnson, Jack"
}
],
"bcc_address": [
{
"address": "Mark.Smith@bcmtr.bcm.corp",
"name": "Smith, Mark"
}
],
"channel_sub_type": "outbound",
"channel_type": "email",
"cid": "CID3467C7DE37AC",
"content": "<p> </p> <p> </p> <p>Confirmation by outgoing email!</p> <p> </p> <p> </p> <p><br> </p> <p><b>----- Description -----</b></p> <p><b>From:</b> Joe.Abraham@bcmtr.bcm.corp</p> <p><b>Created On:</b> 27.05.2016 14:24:27</p> <p><b>To:</b> reg_hunt@bcmtr.bcm.corp</p> <p><b>Cc:</b> Jack@bcmtr.bcm.corp</p> <p><b>Subject:</b> RE: attachments 1</p> <p><b>ID:</b> 10512</p><br><br><br> <p><b>----- Description -----</b></p> <p><b>From:</b> Joe.Abraham@bcmtr.bcm.corp</p> <p><b>Created On:</b> 27.05.2016 14:24:27</p> <p><b>To:</b> reg_hunt@bcmtr.bcm.corp</p> <p><b>Cc:</b> Jack@bcmtr.bcm.corp</p> <p><b>Subject:</b> attachments 1</p> <p><b>ID:</b> 10512</p><br><br> <meta content=\"MSHTML 11.00.9600.18315\" name=\"GENERATOR\"> <style>P { MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px } P {margin:0;} BODY {font-family:arial;}</style> <div style=\"FONT-SIZE: 10pt; FONT-FAMILY: Tahoma; COLOR: #000000; DIRECTION: ltr\">1111</div>",
"date_created": "2016-05-27T11:37:42.060Z",
"destination": "Joe.Abraham@bcmtr.bcm.corp",
"from_address": {
"address": "reg_hunt@bcmtr.bcm.corp",
"name": "REG_Email_Hunt"
},
"from_queue": {
"id": "EE9FB1FEA36A4919A7275DC67DCEF13E",
"name": "REG_Email_Hunt"
},
"id": "B9D3E2C14DAE42AC9EB467A4F6515EE5",
"originator": "reg_hunt@bcmtr.bcm.corp",
"status": "handled",
"title": "Attachments for Offer",
"to_address": [
{
"address": "Joe.Abraham@bcmtr.bcm.corp"
}
]
}
]
Entity representing a email.
Get the email with emailId = {emailId}.
get /emails/{emailId}
Get the email with emailId = {emailId}.
URI Parameters
- emailId: required(string)
Query Parameters
- language: (string)
Define with a two-character code (ISO 639) the language to which the translatable values are translated. By default, logged-on user’s language is used.
Example:
language=FI
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- id: required(string - minLength: 32 - maxLength: 32)
- from_queue: required(object)
- id: required(string - minLength: 32 - maxLength: 32)
- name: required(string)
- channel_type: required(string)
- channel_sub_type: required(string)
- type: required(one of EmailIn, EmailOut)
- typeDetails: required(string)
Operative database has the following email types: ACTION, EMAIL, EMAILOUT, TASK, OII_EMAIL, XRI
- status: required(string)
- statusDetails: required(string)
Operative database has the following statuses: Deleted, Handled, Closed, Pending, Sent, Open, Forwarded
- case_id: (string)
- cid: (string)
- title: required(string)
Email subject.
- content: required(string)
Email body.
- remarks: (string)
Email remarks.
- attachments: (array of AttachmentInfo)
Items: AttachmentInfo
- id: required(string - minLength: 32 - maxLength: 32)
- filename: required(string)
- mime_type: required(string)
- size: required(number)
- originator: required(one of customer, agent)
- originator: required(string)
Source email address.
- destination: required(string)
Email address.
- from_address: required(object)
- name: required(string)
- address: required(string)
- to_address: required(array of EmailAddress)
Items: EmailAddress
- name: required(string)
- address: required(string)
- cc_address: (array of EmailAddress)
Items: EmailAddress
- name: required(string)
- address: required(string)
- bcc_address: (array of EmailAddress)
Items: EmailAddress
- name: required(string)
- address: required(string)
- agentId: (string - minLength: 32 - maxLength: 32)
The agent who is handling or who has handled this contact. Null value not returned - there is no agent.
- agentName: (string)
- date_created: required(datetime)
ISO-8601 UTC timestamp in format 2011-12-31T13:15:30.123Z
Example:
{
"attachments": [
{
"size": 440721,
"filename": "Offer.pdf",
"id": "AA4C7F3C69A64566A0D661ADB0DC0153",
"mime_type": "application/pdf"
},
{
"size": 99440,
"filename": "OfferDetails.xls",
"id": "AAF94FB8567748869A7D873DAEF46B1B",
"mime_type": "application/excel"
},
{
"size": 88252,
"filename": "Info.doc",
"id": "AA36C1E666554638A837CC3408A45614",
"mime_type": "application/msword"
}
],
"case_id": "10512",
"cc_address": [
{
"address": "Jack@bcmtr.bcm.corp",
"name": "Jonhnson, Jack"
}
],
"bcc_address": [
{
"address": "Mark.Smith@bcmtr.bcm.corp",
"name": "Smith, Mark"
}
],
"channel_sub_type": "outbound",
"channel_type": "email",
"cid": "CID3467C7DE37AC",
"content": "<p> </p> <p> </p> <p>Confirmation by outgoing email!</p> <p> </p> <p> </p> <p><br> </p> <p><b>----- Description -----</b></p> <p><b>From:</b> Joe.Abraham@bcmtr.bcm.corp</p> <p><b>Created On:</b> 27.05.2016 14:24:27</p> <p><b>To:</b> reg_hunt@bcmtr.bcm.corp</p> <p><b>Cc:</b> Jack@bcmtr.bcm.corp</p> <p><b>Subject:</b> RE: attachments 1</p> <p><b>ID:</b> 10512</p><br><br><br> <p><b>----- Description -----</b></p> <p><b>From:</b> Joe.Abraham@bcmtr.bcm.corp</p> <p><b>Created On:</b> 27.05.2016 14:24:27</p> <p><b>To:</b> reg_hunt@bcmtr.bcm.corp</p> <p><b>Cc:</b> Jack@bcmtr.bcm.corp</p> <p><b>Subject:</b> attachments 1</p> <p><b>ID:</b> 10512</p><br><br> <meta content=\"MSHTML 11.00.9600.18315\" name=\"GENERATOR\"> <style>P { MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px } P {margin:0;} BODY {font-family:arial;}</style> <div style=\"FONT-SIZE: 10pt; FONT-FAMILY: Tahoma; COLOR: #000000; DIRECTION: ltr\">1111</div>",
"date_created": "2016-05-27T11:37:42.060Z",
"destination": "Joe.Abraham@bcmtr.bcm.corp",
"from_address": {
"address": "reg_hunt@bcmtr.bcm.corp",
"name": "REG_Email_Hunt"
},
"from_queue": {
"id": "EE9FB1FEA36A4919A7275DC67DCEF13E",
"name": "REG_Email_Hunt"
},
"id": "B9D3E2C14DAE42AC9EB467A4F6515EE5",
"originator": "reg_hunt@bcmtr.bcm.corp",
"status": "handled",
"title": "Attachments for Offer",
"to_address": [
{
"address": "Joe.Abraham@bcmtr.bcm.corp"
}
]
}
/scriptResults
Collection of scriptResults.
Get a list of scriptResults.
Adds or updates script results for the given contact. Script, question and answer Ids must be fetched first using
GET /RI/rci/scripts (returns the list of scripts in system)
GET /RI/rci/scripts/:id (returns the details of one script, including questions and answers)
Required fields:
- contact_id - User needs to have MANAGE_CONTACTS right for the contact queue or contact agent.
- script_id - Script Id.
- question.id - Question Id. The given question.data is ignored.
- answer.id - Required when question control type is one of: RADIOBUTTON, CHECKBOX, DROPDOWNLIST, DROPDOWNCHECKBOX, COMBOBOX. In these cases the given answerdata is ignored.
- answer.answerdata - Required when answer.id is not used, with free text control types: INPUTTEXT, TEXTAREA, COMBOBOX.
If script has any mandatory questions, then there needs to be answer to such question.
get /scriptResults
Get a list of scriptResults.
Query Parameters
- contact_id: (string)
Search filtered by "contact id"
Example:
contact_id=599BD2A32FF7364FB2D1B53A31615C7F
- originalcontact_id: (string)
Search filtered by "original contact id"
Example:
originalcontact_id=EB5827A767884A4B91BC4BF66F224903
- limit: (integer - default: <
>) Limit number of elements by specifying a limit value for the query
Example:
limit=20
HTTP status code 200
Body
Media type: application/json
Type: array of object
Items: scriptResults
- id: (string - minLength: 32 - maxLength: 32)
- script_id: required(string - minLength: 32 - maxLength: 32)
- name: (string)
- contact_id: required(string - minLength: 32 - maxLength: 32)
- originalcontact_id: (string - minLength: 32 - maxLength: 32)
- modificationtime: (datetime)
ISO-8601 UTC timestamp in format 2011-12-31T13:15:30.123Z
- scriptquestions: (array of ScriptResultQuestion)
Items: ScriptResultQuestion
- id: required(string - minLength: 32 - maxLength: 32)
- data: (string)
- controltype: (string)
- datatype: (string)
- ordinal: (number)
- scriptanswers: (array of ScriptResultAnswer)
Items: ScriptResultAnswer
- id: (string - minLength: 32 - maxLength: 32)
- answerdata: (string)
- ordinal: (number)
Example:
[
{
"originalcontact_id": "599BD2A32FF7364FB2D1B53A31615C7F",
"contact_id": "599BD2A32FF7364FB2D1B53A31615C7F",
"id": "2B7FB50EF97F416A82AAF48463BA2B5A",
"modificationtime": "2017-03-01T10:00:42.470Z",
"name": "Simple car selector",
"scriptquestions": [
{
"scriptanswers": [
{
"answerdata": "Kia",
"id": "730FBF56981A4657B9285D3B52E7D239",
"ordinal": 0
},
{
"answerdata": "Volvo",
"id": "E34CA4525ABF42CEB7B4A5CCE1AE03E4",
"ordinal": 1
}
],
"controltype": "multicombobox",
"data": "Current Car",
"datatype": "text",
"id": "E6AF572FE79B4550B5CBF621EFB590B7",
"ordinal": 0
},
{
"scriptanswers": [
{
"answerdata": "Hyndai",
"id": "9FCD51FC65334C25851469348E41ADF4",
"ordinal": 2
}
],
"controltype": "multicombobox",
"data": "Next Car",
"datatype": "text",
"id": "B50D16A1D4834047AEFE52325B95377F",
"ordinal": 2
}
],
"script_id": "DCA8D3301BC74B9C8AFCB28026E7761B"
},
{
"originalcontact_id": "AAC3ABD95D26E61180D5005056AD40A2",
"contact_id": "4B713E555D26E61180D5005056AD40A2",
"id": "4F62A6B5A0DD470B84AF3157DB1E23B5",
"modificationtime": "2017-03-01T10:01:21.370Z",
"name": "Simple car selector",
"scriptquestions": [
{
"scriptanswers": [
{
"answerdata": "BMW",
"id": "1881415282E7E61180E3005056AD40A2",
"ordinal": 0
}
],
"controltype": "multicombobox",
"data": "Current Car",
"datatype": "text",
"id": "E6AF572FE79B4550B5CBF621EFB590B7",
"ordinal": 0
},
{
"scriptanswers": [
{
"answerdata": "Mercedes-Benz",
"id": "7186929781E7E61180E3005056AD40A2",
"ordinal": 1
}
],
"controltype": "multicombobox",
"data": "Next Car",
"datatype": "text",
"id": "B50D16A1D4834047AEFE52325B95377F",
"ordinal": 1
}
],
"script_id": "DCA8D3301BC74B9C8AFCB28026E7761B"
}
]
post /scriptResults
Adds or updates script results for the given contact. Script, question and answer Ids must be fetched first using
GET /RI/rci/scripts (returns the list of scripts in system)
GET /RI/rci/scripts/:id (returns the details of one script, including questions and answers)
Required fields:
- contact_id - User needs to have MANAGE_CONTACTS right for the contact queue or contact agent.
- script_id - Script Id.
- question.id - Question Id. The given question.data is ignored.
- answer.id - Required when question control type is one of: RADIOBUTTON, CHECKBOX, DROPDOWNLIST, DROPDOWNCHECKBOX, COMBOBOX. In these cases the given answerdata is ignored.
- answer.answerdata - Required when answer.id is not used, with free text control types: INPUTTEXT, TEXTAREA, COMBOBOX.
If script has any mandatory questions, then there needs to be answer to such question.
Body
Media type: application/json
Type: object
Properties- id: (string - minLength: 32 - maxLength: 32)
- script_id: required(string - minLength: 32 - maxLength: 32)
- name: (string)
- contact_id: required(string - minLength: 32 - maxLength: 32)
- originalcontact_id: (string - minLength: 32 - maxLength: 32)
- modificationtime: (datetime)
ISO-8601 UTC timestamp in format 2011-12-31T13:15:30.123Z
- scriptquestions: (array of ScriptResultQuestion)
Items: ScriptResultQuestion
- id: required(string - minLength: 32 - maxLength: 32)
- data: (string)
- controltype: (string)
- datatype: (string)
- ordinal: (number)
- scriptanswers: (array of ScriptResultAnswer)
Items: ScriptResultAnswer
- id: (string - minLength: 32 - maxLength: 32)
- answerdata: (string)
- ordinal: (number)
Example:
One answer with id and another with text value:
{
"script_id": "547CD5E084664390909C38913E0EB475",
"contact_id": "A8343972F3044DD7ADA94CC6EF39BD49",
"scriptquestions": [
{
"id": "585ECF83A1AA4481A90DC2710BAD1B4B",
"scriptanswers": [
{
"id": "E2A8979A0FE641AFA82A7B07FCE69AE4"
}
]
},
{
"id": "D5BA40B77D854F3D803F9A3AD208D295",
"scriptanswers": [
{
"answerdata": "free text"
}
]
}
]
}
HTTP status code 201
Returns the created id.
Body
Media type: text/html
Type: any
Example:
F5168FBDD6914C8DB1C6D0BD64563A39
Entity representing a scriptResult.
Get the scriptResult with scriptResultId = {scriptResultId}.
get /scriptResults/{scriptResultId}
Get the scriptResult with scriptResultId = {scriptResultId}.
URI Parameters
- scriptResultId: required(string)
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- id: (string - minLength: 32 - maxLength: 32)
- script_id: required(string - minLength: 32 - maxLength: 32)
- name: (string)
- contact_id: required(string - minLength: 32 - maxLength: 32)
- originalcontact_id: (string - minLength: 32 - maxLength: 32)
- modificationtime: (datetime)
ISO-8601 UTC timestamp in format 2011-12-31T13:15:30.123Z
- scriptquestions: (array of ScriptResultQuestion)
Items: ScriptResultQuestion
- id: required(string - minLength: 32 - maxLength: 32)
- data: (string)
- controltype: (string)
- datatype: (string)
- ordinal: (number)
- scriptanswers: (array of ScriptResultAnswer)
Items: ScriptResultAnswer
- id: (string - minLength: 32 - maxLength: 32)
- answerdata: (string)
- ordinal: (number)
Example:
{
"originalcontact_id": "599BD2A32FF7364FB2D1B53A31615C7F",
"contact_id": "599BD2A32FF7364FB2D1B53A31615C7F",
"id": "2B7FB50EF97F416A82AAF48463BA2B5A",
"modificationtime": "2017-03-01T10:00:42.470Z",
"name": "Simple car selector",
"scriptquestions": [
{
"scriptanswers": [
{
"answerdata": "Kia",
"id": "730FBF56981A4657B9285D3B52E7D239",
"ordinal": 0
},
{
"answerdata": "Volvo",
"id": "E34CA4525ABF42CEB7B4A5CCE1AE03E4",
"ordinal": 1
}
],
"controltype": "multicombobox",
"data": "Current Car",
"datatype": "text",
"id": "E6AF572FE79B4550B5CBF621EFB590B7",
"ordinal": 0
},
{
"scriptanswers": [
{
"answerdata": "Hyndai",
"id": "9FCD51FC65334C25851469348E41ADF4",
"ordinal": 2
}
],
"controltype": "multicombobox",
"data": "Next Car",
"datatype": "text",
"id": "B50D16A1D4834047AEFE52325B95377F",
"ordinal": 2
}
],
"script_id": "DCA8D3301BC74B9C8AFCB28026E7761B"
}
/chats
Collection of chats.
Get a list of chats.
get /chats
Get a list of chats.
Query Parameters
- language: (string)
Define with a two-character code (ISO 639) the language to which the translatable values are translated. By default, logged-on user’s language is used.
Example:
language=FI
- originator: (string)
Search filtered by originating address of the chat.
Example:
originator=john.doe@acme.com
- channel_sub_type: (string)
Search filtered by channel sub type text, video or sms
Example:
channel_sub_type=sms
- destination: (string)
Search filtered by destination address of the chat.
Example:
destination=123456Support@Test.com
- limit: (integer - default: <
>) Limit number of elements by specifying a limit value for the query
Example:
limit=20
HTTP status code 200
Body
Media type: application/json
Type: array of object
Items: chats
- id: required(string - minLength: 32 - maxLength: 32)
- channel_type: required(string)
- channel_sub_type: required(string)
- type: required(one of ChatIn, ChatOut)
- typeDetails: required(string)
Operative database has the following types: Chat, ChatOut
- status: required(one of InQueue, InProcess, Handled, Abandoned)
- statusDetails: required(string)
Operative database has the following statuses: Deleted, Handled, Closed, Pending, Sent, Open, Forwarded
- originator: required(string)
Source address. Phone number or email address.
- destination: required(string)
Phone number or email address.
- date_created: required(datetime)
ISO-8601 UTC timestamp in format 2011-12-31T13:15:30.123Z
- from_queue: required(object)
- id: required(string - minLength: 32 - maxLength: 32)
- name: required(string)
- participants: (array of ChatParticipant)
Included only when only one chat is fetched.
Items: ChatParticipant
- alias: required(string)
- uniquekey: required(string)
- transcript: (object)
Included only when only one chat is fetched.
- messages: required(array of ChatTranscript)
Items: ChatTranscript
- message: required(string)
- originator: required(string)
- timestamp: required(datetime)
ISO-8601 UTC timestamp in format 2011-12-31T13:15:30.123Z
- system_message: required(boolean)
- type: required(one of text, attachment)
- messages: required(array of ChatTranscript)
- agentId: (string - minLength: 32 - maxLength: 32)
The agent who is handling or who has handled this contact. Null value not returned - there is no agent.
- agentName: (string)
Example:
[
{
"id": "9964A286A4E711E680F7005056AD5BC6",
"originator": "sam.i.am@greeneggs.ham",
"destination": " 123456Support@Test.com",
"from_queue": {
"id": "999102030405060708090A0B0C0D0E0F",
"name": "My support chat"
},
"title": "",
"date_created": "2016-11-07T12:42:12.670Z",
"channel_type": "chat",
"channel_sub_type": "text"
},
{
"id": "2558A56EAFF511E680F7005056AD5BC6",
"originator": "jill@customer.com",
"destination": " 987654Sales@Test.com",
"from_queue": {
"id": "999102030405060708090A0B0C0D0E0F",
"name": "My sales chat"
},
"date_created": "2016-11-21T14:16:57.477Z",
"title": "",
"channel_type": "chat",
"channel_sub_type": "text"
}
]
post /chats
Body
Media type: application/json
Type: object
Properties- channel_type: required(one of chat, chatout)
- channel_sub_type: required(string)
For example text, sms, whatsapp, telegram. Use some subtype that is in use in your system.
- originator: required(string)
Source address. Phone number or email address.
- destination: required(string)
Phone number or email address.
- title: required(string - maxLength: 256)
- from_queue: required(object)
- id: required(string - minLength: 32 - maxLength: 32)
- participants: (array of ChatParticipant)
Items: ChatParticipant
- alias: required(string)
- uniquekey: required(string)
- transcript: required(object)
- messages: required(array of NewChatTranscript)
Items: NewChatTranscript
- message: required(string)
- originator: required(string)
- timestamp: (datetime)
ISO-8601 UTC timestamp in format 2011-12-31T13:15:30.123Z
- system_message: (boolean)
- type: (text - default: text)
- messages: required(array of NewChatTranscript)
Examples:
Inbound chat discussion:
{
"originator": "sam.i.am@greeneggs.ham",
"destination": " 123456Support@Test.com",
"from_queue": {
"id": "999102030405060708090A0B0C0D0E0F",
"name": "My support chat"
},
"title": "Discussion with Bot",
"channel_type": "chat",
"channel_sub_type": "text",
"participants": [
{
"alias": "Sam",
"uniquekey": "sam.i.am@greeneggs.ham"
},
{
"alias": "The Bot",
"uniquekey": "bot@acme.com"
}
],
"transcript": {
"messages": [
{
"message": "Goodbye. Please wait while I transfer you to the queue. Have a nice day.",
"originator":"bot@acme.com",
"timeStamp": "2021-08-07T12:44:22.453Z",
"type": "text"
},
{
"message": "I would like to talk to a human agent",
"originator": "sam.i.am@greeneggs.ham",
"timeStamp": "2021-08-07T12:44:21.453Z",
"type": "text"
},
{
"message": "Is there anything else I can help with?",
"originator": "bot@acme.com",
"timeStamp": "2021-08-07T12:44:20.453Z",
"type": "text"
},
{
"message": "Welcome! How can I help you?",
"originator": "bot@acme.com",
"timeStamp": "2021-08-07T12:44:19.453Z",
"type": "text"
}
]
}
}
Outbound chat message:
{
"originator": "kjiouioy9i89987ttydrtxfc@sms.sinchconversation.com",
"destination": "+5521244222225555",
"from_queue": {
"id": "999102030405060708090A0B0C0D0E0F",
"name": "Sinch conversation SMS Queue"
},
"title": "",
"date_created": "2021-11-07T12:42:12.670Z",
"channel_type": "chatout",
"channel_sub_type": "sms",
"participants": [
{
"alias": "SMS Queue",
"uniquekey": "kjiouioy9i89987ttydrtxfc@sms.sinchconversation.com"
}
],
"transcript": {
"messages": [
{
"message": "It's time do yearly maintenance for your Mercedes. You can call us or check our website www.sinch.com for booking online.",
"originator":"kjiouioy9i89987ttydrtxfc@sms.sinchconversation.com"
}
]
}
}
HTTP status code 201
Returns the created id.
Body
Media type: text/html
Type: any
Example:
F5168FBDD6914C8DB1C6D0BD64563A39
Entity representing a chat.
Get the chat with chatId = {chatId}.
get /chats/{chatId}
Get the chat with chatId = {chatId}.
URI Parameters
- chatId: required(string)
Query Parameters
- language: (string)
Define with a two-character code (ISO 639) the language to which the translatable values are translated. By default, logged-on user’s language is used.
Example:
language=FI
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- id: required(string - minLength: 32 - maxLength: 32)
- channel_type: required(string)
- channel_sub_type: required(string)
- type: required(one of ChatIn, ChatOut)
- typeDetails: required(string)
Operative database has the following types: Chat, ChatOut
- status: required(one of InQueue, InProcess, Handled, Abandoned)
- statusDetails: required(string)
Operative database has the following statuses: Deleted, Handled, Closed, Pending, Sent, Open, Forwarded
- originator: required(string)
Source address. Phone number or email address.
- destination: required(string)
Phone number or email address.
- date_created: required(datetime)
ISO-8601 UTC timestamp in format 2011-12-31T13:15:30.123Z
- from_queue: required(object)
- id: required(string - minLength: 32 - maxLength: 32)
- name: required(string)
- participants: (array of ChatParticipant)
Included only when only one chat is fetched.
Items: ChatParticipant
- alias: required(string)
- uniquekey: required(string)
- transcript: (object)
Included only when only one chat is fetched.
- messages: required(array of ChatTranscript)
Items: ChatTranscript
- message: required(string)
- originator: required(string)
- timestamp: required(datetime)
ISO-8601 UTC timestamp in format 2011-12-31T13:15:30.123Z
- system_message: required(boolean)
- type: required(one of text, attachment)
- messages: required(array of ChatTranscript)
- agentId: (string - minLength: 32 - maxLength: 32)
The agent who is handling or who has handled this contact. Null value not returned - there is no agent.
- agentName: (string)
Example:
{
"id": "9964A286A4E711E680F7005056AD5BC6",
"originator": "sam.i.am@greeneggs.ham",
"destination": " 123456Support@Test.com",
"from_queue": {
"id": "999102030405060708090A0B0C0D0E0F",
"name": "My support chat"
},
"title": "",
"date_created": "2016-11-07T12:42:12.670Z",
"channel_type": "chat",
"channel_sub_type": "text",
"participants": [
{
"alias": "Mark",
"uniquekey": "Mark.Smith@SinchCCtr.com"
},
{
"alias": "Sam",
"uniquekey": "sam.i.am@greeneggs.ham"
},
{
"alias": "John",
"uniquekey": "John.Doe@SinchCCtr.com"
},
{
"alias": "",
"uniquekey": "Sinch Contact Center"
}
],
"transcript": {
"messages": [
{
"message": "Bye",
"originator": "Mark.Smith@SinchCCtr.com",
"timeStamp": "2016-11-07T12:44:27.667Z",
"type": "text",
"system_message": false
},
{
"message": "No, many thanks. Bye",
"originator": "sam.i.am@greeneggs.ham",
"timeStamp": "2016-11-07T12:44:25.220Z",
"type": "text",
"system_message": false
},
{
"message": "Is there anything else I can help with ?",
"originator": "Mark.Smith@SinchCCtr.com",
"timeStamp": "2016-11-07T12:44:19.453Z",
"type": "text",
"system_message": false
},
{
"message": "I will send this to you at your provided address",
"originator": "Mark.Smith@SinchCCtr.com",
"timeStamp": "2016-11-07T12:44:12.657Z",
"type": "text",
"system_message": false
},
{
"message": "I am happy to help you with your catalogue request",
"originator": "Mark.Smith@SinchCCtr.com",
"timeStamp": "2016-11-07T12:44:01.997Z",
"type": "text",
"system_message": false
},
{
"message": "This is Mark",
"originator": "Mark.Smith@SinchCCtr.com",
"timestamp": "2016-11-07T12:43:47.087Z",
"type": "text",
"system_message": false
},
{
"message": "Hello.",
"originator": "Mark.Smith@SinchCCtr.com",
"timestamp": "2016-11-07T12:43:44.763Z",
"type": "text",
"system_message": false
},
{
"message": "One moment please",
"originator": "John.Doe@SinchCCtr.com",
"timestamp": "2016-11-07T12:43:08.927Z",
"type": "text",
"system_message": false
},
{
"message": "Sure, let me transfer you to the colleague in that department",
"originator": "John.Doe@SinchCCtr.com",
"timestamp": "2016-11-07T12:43:02.877Z",
"type": "text",
"system_message": false
},
{
"message": "Hi, Could you help me with purchases of bikes? I would like the latest catalogue?",
"originator": "sam.i.am@greeneggs.ham",
"timestamp": "2016-11-07T12:42:50.850Z",
"type": "text",
"system_message": false
},
{
"message": "Hello. How may I help you?",
"originator": "John.Doe@SinchCCtr.com",
"timestamp": "2016-11-07T12:42:27.867Z",
"type": "text",
"system_message": false
},
{
"message": "Position in queue: 1 - \nNumber of agents: 4",
"originator": "Sinch Contact Center",
"timestamp": "2016-11-07T12:42:10.953Z",
"type": "text",
"system_message": true
}
]
}
}
/callRecordings
Collection of callRecordings.
Get a list of callRecordings.
get /callRecordings
Get a list of callRecordings.
Query Parameters
- language: (string)
Define with a two-character code (ISO 639) the language to which the translatable values are translated. By default, logged-on user’s language is used.
Example:
language=FI
- call_id: (string)
Search filtered by "call id"
Example:
call_id=475CD7FA939747CD9885379F5C4DEE08
- contact_id: (string)
Search filtered by "contact id"
Example:
contact_id=76155631FB5BE711810B005056AD5BC6
- start_time: (string)
Search recordings after of given UTC time
Example:
start_time=2017-06-28T06:00:00.000Z
- end_time: (string)
Search recordings before of given UTC time
Example:
end_time=2017-06-28T12:00:00.000Z
- limit: (integer - default: <
>) Limit number of elements by specifying a limit value for the query
Example:
limit=20
HTTP status code 200
Body
Media type: application/json
Type: array of object
Items: callRecordings
- id: required(string - minLength: 32 - maxLength: 32)
- call_id: required(string - minLength: 32 - maxLength: 32)
- contact_id: required(string - minLength: 32 - maxLength: 32)
- owner_id: required(string - minLength: 32 - maxLength: 32)
- owner_type: required(one of user, queue, outbound campaign)
- owner_name: required(string)
- file_name: required(string)
- file_path: required(string)
- creation_time: required(datetime)
ISO-8601 UTC timestamp in format 2011-12-31T13:15:30.123Z
- listen_log: required(array of CallRecordingListenLog)
Included only when only one call recording is fetched.
Items: CallRecordingListenLog
- id: (string - minLength: 32 - maxLength: 32)
- user_guid: (string - minLength: 32 - maxLength: 32)
The currently logged in user is used when posting new.
- user_id: (string)
Login name. The currently logged in user is used when posting new.
- user_name: (string)
The currently logged in user is used when posting new.
- description: required(string)
Required when posting new.
- userSessionId: required(string)
Required when posting new.
- time_stamp: (datetime)
ISO-8601 UTC timestamp in format 2011-12-31T13:15:30.123Z The current server time is used in posting if not given.
Example:
[
{
"call_id": "D8296FEDDB374F4EABAF6F9A555F3853",
"contact_id": "B4C00F7C6061E711810B005056AD5BC6",
"creation_time": "2017-07-05T09:01:25.597Z",
"file_name": "100\\2017_07_00\\05_12_01_14_SSR_100_D8296FEDDB374F4EABAF6F9A555F3853.wav",
"file_path": "",
"id": "0530B4826061E711810B005056AD5BC6",
"owner_id": "C04DEC26C5EF4D44BAE5CEE3F2EF67F7",
"owner_name": "Jonhnson, Jack",
"owner_type": "user"
},
{
"call_id": "6E4F2AE072134F23A281F8B74B472C27",
"contact_id": "ED453D546061E711810B005056AD5BC6",
"creation_time": "2017-07-05T09:00:22.473Z",
"file_name": "100\\2017_07_00\\05_12_00_11_SSR_100_6E4F2AE072134F23A281F8B74B472C27.wav",
"file_path": "",
"id": "A7DFE85A6061E711810B005056AD5BC6",
"owner_id": "C04DEC26C5EF4D44BAE5CEE3F2EF67F7",
"owner_name": "Jonhnson, Jack",
"owner_type": "user"
},
{
"call_id": "475CD7FA939747CD9885379F5C4DEE08",
"contact_id": "76155631FB5BE711810B005056AD5BC6",
"creation_time": "2017-06-28T12:14:11.517Z",
"file_name": "Cr\\2017_06_04\\28_15_13_39_SSR_Cr_475CD7FA939747CD9885379F5C4DEE08.wav",
"file_path": "",
"id": "8734EC49FB5BE711810B005056AD5BC6",
"owner_id": "58215C79F02345EF8E32CF7356F78065",
"owner_name": "Direct Sales",
"owner_type": "queue"
},
{
"call_id": "475CD7FA939747CD9885379F5C4DEE08",
"contact_id": "76155631FB5BE711810B005056AD5BC6",
"creation_time": "2017-06-28T12:13:47.260Z",
"file_name": "12888\\2017_06_04\\28_15_13_39_SSR_12888_475CD7FA939747CD9885379F5C4DEE08.wav",
"file_path": "",
"id": "B4A74B3AFB5BE711810B005056AD5BC6",
"owner_id": "D0248B3AE770490EA9A7BE954BE7BA63",
"owner_name": "Smith, Mark",
"owner_type": "user"
}
]
Entity representing a callRecording.
Get the callRecording with callRecordingId = {callRecordingId}.
get /callRecordings/{callRecordingId}
Get the callRecording with callRecordingId = {callRecordingId}.
URI Parameters
- callRecordingId: required(string)
Query Parameters
- language: (string)
Define with a two-character code (ISO 639) the language to which the translatable values are translated. By default, logged-on user’s language is used.
Example:
language=FI
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- id: required(string - minLength: 32 - maxLength: 32)
- call_id: required(string - minLength: 32 - maxLength: 32)
- contact_id: required(string - minLength: 32 - maxLength: 32)
- owner_id: required(string - minLength: 32 - maxLength: 32)
- owner_type: required(one of user, queue, outbound campaign)
- owner_name: required(string)
- file_name: required(string)
- file_path: required(string)
- creation_time: required(datetime)
ISO-8601 UTC timestamp in format 2011-12-31T13:15:30.123Z
- listen_log: required(array of CallRecordingListenLog)
Included only when only one call recording is fetched.
Items: CallRecordingListenLog
- id: (string - minLength: 32 - maxLength: 32)
- user_guid: (string - minLength: 32 - maxLength: 32)
The currently logged in user is used when posting new.
- user_id: (string)
Login name. The currently logged in user is used when posting new.
- user_name: (string)
The currently logged in user is used when posting new.
- description: required(string)
Required when posting new.
- userSessionId: required(string)
Required when posting new.
- time_stamp: (datetime)
ISO-8601 UTC timestamp in format 2011-12-31T13:15:30.123Z The current server time is used in posting if not given.
Example:
{
"call_id": "475CD7FA939747CD9885379F5C4DEE08",
"contact_id": "08355C40FB5BE711810B005056AD5BC6",
"creation_time": "2017-06-28T12:14:11.517Z",
"file_name": "12888\\2017_06_04\\28_15_14_08_SSR_12888_475CD7FA939747CD9885379F5C4DEE08.wav",
"file_path": "",
"id": "8534EC49FB5BE711810B005056AD5BC6",
"listen_log": [
{
"description": "xxx",
"time_stamp": "2017-06-28T12:16:23.517Z",
"user_guid": "D0248B3AE770490EA9A7BE954BE7BA63",
"user_id": "mark.smith",
"user_name": "Smith, Mark"
}
],
"owner_id": "D0248B3AE770490EA9A7BE954BE7BA63",
"owner_name": "Smith, Mark",
"owner_type": "user"
}
Collection of listenLog.
Get a list of listenLog.
Add a new listenLog.
get /callRecordings/{callRecordingId}/listenLog
Get a list of listenLog.
URI Parameters
- callRecordingId: required(string)
Query Parameters
- language: (string)
Define with a two-character code (ISO 639) the language to which the translatable values are translated. By default, logged-on user’s language is used.
Example:
language=FI
HTTP status code 200
Body
Media type: application/json
Type: array of object
Items: listenLogs
- id: (string - minLength: 32 - maxLength: 32)
- user_guid: (string - minLength: 32 - maxLength: 32)
The currently logged in user is used when posting new.
- user_id: (string)
Login name. The currently logged in user is used when posting new.
- user_name: (string)
The currently logged in user is used when posting new.
- description: required(string)
Required when posting new.
- userSessionId: required(string)
Required when posting new.
- time_stamp: (datetime)
ISO-8601 UTC timestamp in format 2011-12-31T13:15:30.123Z The current server time is used in posting if not given.
Example:
[
{
"id": "F0DA314476984627B84BE99AB98C6AA6",
"description": "listened because",
"userSessionId": "6936084DBA3C4941C80F2CB2E3EC00E3",
"user_guid": "B2C178ABC2E84BA4A7E5B091E3FC5451",
"user_id": "Agent Login",
"user_name": "Agent, Name",
"time_stamp": "2016-04-15T05:58:53.650Z"
},
{
"id": "4933E5ECB9784F1C96A5F6E047995432",
"description": "listened again",
"userSessionId": "userSessionId",
"user_guid": "30BAC5C8C39A4CA5A5B1C5509EE4F12B",
"user_id": "Agent2 Login",
"user_name": "Agent2, Name",
"time_stamp": "2016-04-15T05:58:53.650Z"
}
]
post /callRecordings/{callRecordingId}/listenLog
Add a new listenLog.
URI Parameters
- callRecordingId: required(string)
Body
Media type: application/json
Type: object
Properties- id: (string - minLength: 32 - maxLength: 32)
- user_guid: (string - minLength: 32 - maxLength: 32)
The currently logged in user is used when posting new.
- user_id: (string)
Login name. The currently logged in user is used when posting new.
- user_name: (string)
The currently logged in user is used when posting new.
- description: required(string)
Required when posting new.
- userSessionId: required(string)
Required when posting new.
- time_stamp: (datetime)
ISO-8601 UTC timestamp in format 2011-12-31T13:15:30.123Z The current server time is used in posting if not given.
Example:
{
"description": "listened because",
"userSessionId": "6936084DBA3C4941C80F2CB2E3EC00E3"
}
HTTP status code 201
Returns the created id.
Body
Media type: text/html
Type: any
Example:
F5168FBDD6914C8DB1C6D0BD64563A39
/callbacks
Collection of callbacks.
Get a list of callbacks.
Add a new callback.
Note: Built-in Callback IVR Number needs to be defined to the system in order to add new callbacks with this resource.
get /callbacks
Get a list of callbacks.
Query Parameters
- any fields: (string)
&field1=value1&field2=value2...
Values may contain patterns * and ?
Valid searchable fields: customerNumberExample:
customerNumber=*987654
HTTP status code 200
Body
Media type: application/json
Type: array of object
Items: callbacks
- id: required(string - minLength: 32 - maxLength: 32)
- callbackQueueNumber: required(string)
- creationTime: required(datetime)
- creatorId: (string - minLength: 32 - maxLength: 32)
- creatorName: (string)
- customerNumber: required(string)
- extraData: (string)
- gwPrefix: (string)
- failures: required(number)
- lastCallTime: (datetime)
- lastResult: (string)
- maxCalls: required(number)
- nextCallTime: (datetime)
- notes: (string)
- originalQueueNumber: required(string)
- originalQueueName: (string)
Example:
[
{
"callbackQueueNumber": "153",
"creationTime": "2019-09-13T11:51:17.670Z",
"customerNumber": "+35854852156",
"extraData": "<XML><Skills>ENGLISH=4</Skills></XML>",
"gwPrefix": "FIN",
"failures": 1,
"id": "C42C6D5CF4004CC3B75E104654D9C5BE",
"lastCallTime": "2019-09-16T14:25:02.840Z",
"lastResult": "NO_ANSWER",
"maxCalls": 99,
"nextCallTime": "2019-09-13T11:52:21.480Z",
"notes": "Comments",
"originalQueueNumber": "152",
"originalQueueName": "Sales"
},
{
"callbackQueueNumber": "153",
"creationTime": "2019-09-13T11:51:16.433Z",
"creatorId": "8EE34E893B224131AACF44677F60CF54",
"creatorName": "Smith, John",
"customerNumber": "124",
"failures": 0,
"id": "806822AF40244A29A3374C3EF98C53DA",
"lastResult": "ADDED",
"maxCalls": 99,
"nextCallTime": "2019-09-13T11:52:21.480Z",
"originalQueueNumber": "152",
"originalQueueName": "Sales"
}
]
post /callbacks
Add a new callback.
Note: Built-in Callback IVR Number needs to be defined to the system in order to add new callbacks with this resource.
Body
Media type: application/json
Type: object
Properties- callbackQueueNumber: required(string)
- customerNumber: required(string)
- extraData: (string)
- gwPrefix: (string)
- nextCallTime: (datetime)
- notes: (string)
Example:
{
"nextCallTime": "2019-10-04T12:36:02.440Z",
"customerNumber": "85412369512",
"callbackQueueNumber": "505"
}
HTTP status code 201
Returns the created id.
Body
Media type: text/html
Type: any
Example:
F5168FBDD6914C8DB1C6D0BD64563A39
Entity representing a callback.
Get the callback with callbackId = {callbackId}.
Update the callback with callbackId = {callbackId}
Only fields customerNumber, notes, lastResult and nextCallTime are updated. Others are ignored.
nextCallTime is only allowed when lastResult is either CUSTOM_TIME or RESCHEDULE.
get /callbacks/{callbackId}
Get the callback with callbackId = {callbackId}.
URI Parameters
- callbackId: required(string)
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- id: required(string - minLength: 32 - maxLength: 32)
- callbackQueueNumber: required(string)
- creationTime: required(datetime)
- creatorId: (string - minLength: 32 - maxLength: 32)
- creatorName: (string)
- customerNumber: required(string)
- extraData: (string)
- gwPrefix: (string)
- failures: required(number)
- lastCallTime: (datetime)
- lastResult: (string)
- maxCalls: required(number)
- nextCallTime: (datetime)
- notes: (string)
- originalQueueNumber: required(string)
- originalQueueName: (string)
Example:
{
"callbackQueueNumber": "153",
"creationTime": "2019-09-13T11:51:17.670Z",
"creatorId": "8EE34E893B224131AACF44677F60CF54",
"creatorName": "Smith, John",
"customerNumber": "+35854852156",
"extraData": "<XML><Skills>ENGLISH=4</Skills></XML>",
"gwPrefix": "FIN",
"failures": 1,
"id": "C42C6D5CF4004CC3B75E104654D9C5BE",
"lastCallTime": "2019-09-16T14:25:02.840Z",
"lastResult": "NO_ANSWER",
"maxCalls": 99,
"nextCallTime": "2019-09-13T11:52:21.480Z",
"notes": "Comments",
"originalQueueNumber": "152",
"originalQueueName": "Sales"
}
put /callbacks/{callbackId}
Update the callback with callbackId = {callbackId}
Only fields customerNumber, notes, lastResult and nextCallTime are updated. Others are ignored.
nextCallTime is only allowed when lastResult is either CUSTOM_TIME or RESCHEDULE.
URI Parameters
- callbackId: required(string)
Body
Media type: application/json
Type: object
Properties- id: (string - minLength: 32 - maxLength: 32)
- creationTime: (datetime)
- customerNumber: required(string)
- extraData: (string)
- gwPrefix: (string)
- failures: (number)
- lastCallTime: (datetime)
- lastResult: required(one of SUCCESSFUL, BUSY, NO_ANSWER, VOICEMAIL, CUSTOM_TIME, OTHER, HANDLED, RESCHEDULE)
- maxCalls: (number)
- nextCallTime: (datetime)
- notes: required(string)
- originalQueueNumber: (string)
- originalQueueName: (string)
- callbackQueueNumber: (string)
Example:
{
"callbackQueueNumber": "153",
"creationTime": "2019-09-13T11:51:17.670Z",
"customerNumber": "+35854852156",
"id": "C42C6D5CF4004CC3B75E104654D9C5BE",
"lastCallTime": "2019-09-16T14:25:02.840Z",
"lastResult": "HANDLED",
"notes": "Comments",
"originalQueueNumber": "152",
"originalQueueName": "Sales"
}
HTTP status code 204
No content - The server has successfully fulfilled the request and there is no additional content to send in the response payload body.
/contacts
Collection of contacts (phone calls, chats, emails). By default the contacts are returned from monitoring/reporting databases, but if search criteria contains subject, body or remarks, then the search is done from operative database.
Get a list of contacts.
get /contacts
Get a list of contacts.
Query Parameters
- search: (string)
Searches by source or destination. Can have multiple values separated by comma.
Example:
search=*987654, search=email@host.com, search=*987654,email@host.com
- startTime: (string)
arrivalTime or disconnectTime >= value
Example:
startTime=2019-10-17T16:25:59Z
- endTime: (string)
arrivalTime or disconnectTime <= value
Example:
endTime=2019-10-17T16:25:59Z
- subject: (string)
Search email or chat subject using full-text search. If value contains " characters, then it is assumed to be in full text format already.
Example:
subject=text
- body: (string)
Search email body or chat message. Email body is searched by using full-text search. Chat message must contain the value somewhere.
Example:
body=text
- remarks: (string)
Search email remarks using using full-text search.
Example:
remarks=text
- caseId: (string)
Search email caseId.
Example:
caseId=12345
- agentId: (string)
Search by agentId. Allows comma separated list.
Example:
agentId=E936C474B22311D38FBE0090279A922E,A206C474B22311D38FBE0090279A922E
- queueId: (string)
Search by queueId. Allows comma separated list.
Example:
queueId=F8C2697F37D044DB929B10F75381C624,990556DC18244B4AB5BF35D75A89CDEF
- contactGroupId: (string)
Search by contactGroupId. Allows comma separated list, in which case the ID must be in correct format, with hyphens (chats, emails) or without (phone calls).
Example:
contactGroupId=B4AFCD2C-A791-4D1D-8ED6-AF4E25AEA096,990556DC18244B4AB5BF35D75A89CDEF
- pickable: (boolean)
Can be filtered to return only pickable contacts. Contact is pickable if agent has STATISTICS_DETAILS right to see the contact (queue/agent), and if agent has SERVE right to the queue. Currently phone calls can't be picked. Contact status must be one of:
- status=InQueue (chat, email)
- status=InProcess (inbound email, or outbound email which was created by the same agent)
Example:
pickable=true
- statistics: (boolean)
Adds statistics to result:
- connectTime datetime (null if not connected)
- waitingDuration number (milliseconds)
- handlingDuration number (milliseconds)
- wrapUpTotalDuration number (milliseconds)
Example:
statistics=true
- any fields: (string)
&field1=value1&field2=value2...
Values may contain patterns * and ?
Valid searchable fields: id,contactGroupId,source,destination,customerName,...Example:
?source=*987654&destination=email@host.com
- language: (string)
Define with a two-character code (ISO 639) the language to which the translatable values are translated. By default, logged-on user’s language is used.
Example:
language=FI
- sort: (string)
Can be sorted by any field. Default sort is -arrivalTime. "-" in front of field name will sort descending. With the postfix ",LOCALE-xx" where xx can be for example en,en-US,de,fi, the user may sort with given locale that are based on standard "IETF BCP 47".
Example:
sort=-arrivalTime,LOCALE-en
- limit: (integer - default: <
>) Limit number of elements by specifying a limit value for the query
Example:
limit=20
HTTP status code 200
Body
Media type: application/json
Type: array of object
Items: contacts
- id: required(string - minLength: 32 - maxLength: 32)
- contactGroupId: required(string - minLength: 32 - maxLength: 36)
When contact is transferred, then it gets the new id but contactGroupId stays the same. Chats and emails have 36 characters with hyphens, while phone calls have 32 characters without hyphens.
- channel: required(one of PHONE, CHAT, EMAIL)
- type: required(one of CallIn, CallOut, ChatIn, ChatOut, EmailIn, EmailOut)
- typeDetails: required(string)
Original type from Monitoring/Reporting(/Operative) database. Use "type" and "subtype" instead.
- subtype: (one of text, video, sms, facebook, wechat, whatsapp, EMAIL, EMAILOUT, ACTION, TASK, XRI, OII_EMAIL)
Chat or email channel subtype. Chat subtypes in lower case, email subtypes in upper case.
- status: required(one of Pending, InQueue, InProcess, WrapUp, Handled, Abandoned, Deleted)
- statusDetails: required(string)
Original (more detailed) status from Monitoring/Reporting(/Operative) database.
- source: required(string)
Phone number or email address.
- destination: required(string)
Phone number or email address.
- customerName: (string)
Display name of the customer. For chat channel only.
- agentId: (string - minLength: 32 - maxLength: 32)
The agent who is handling or who has handled this contact. Null value not returned - there is no agent.
- agentName: (string)
- queueId: (string - minLength: 32 - maxLength: 32)
The queue in which this contact was created. Null value not returned - there is no queue.
- queueName: (string)
- arrivalTime: required(datetime)
ISO-8601 UTC timestamp in format 2011-12-31T13:15:30.123Z
- disconnectTime: (datetime)
Null if contact is not ended yet.
- totalDuration: required(number)
Milliseconds from arrivalTime to disconnectTime or to current time.
- record: (boolean)
True if contact is phone call and has recording, null otherwise.
- script: (boolean)
True if contact has script, null otherwise.
- subject: (string)
- requiredAgent: (object)
Required or preferred agent if queuing/pending contact has one.
- id: required(string - minLength: 32 - maxLength: 32)
Required/preferred agent ID.
- name: required(string)
Required/preferred agent name.
- type: required(number)
1 if required agent, 2 if preferred agent.
- expirationTime: (datetime)
ISO-8601 UTC timestamp in format 2011-12-31T13:15:30.123Z.
- id: required(string - minLength: 32 - maxLength: 32)
- connectTime: (datetime)
ISO-8601 UTC timestamp in format 2011-12-31T13:15:30.123Z, null if not connected. Provided only if statistics=true is given.
- waitingDuration: (number)
Milliseconds from arrivalTime to connectTime (if connected) or to disconnectTime (if not connected) or to current time (if still in queue). Provided only if statistics=true is given.
- handlingDuration: (number)
Milliseconds from connectTime (if connected) to disconnectTime or to current time (if still in process). Provided only if statistics=true is given.
- wrapUpTotalDuration: (number)
Milliseconds from disconnectTime to wrap-up ended time (not provided) or to current time (if still in wrap-up). Provided only if statistics=true is given.
Example:
{
{
"id": "DBEC8B07E3F0E9119E1D0050568C5E24",
"contactGroupId": "73CED646FA0947E0AA4E0367FB1B9BCC",
"channel": "PHONE",
"type": "CallIn",
"typeDetails": "IVR",
"status": "Handled",
"statusDetails": "Handled_AOT",
"source": "0505551234",
"destination": "0505550000",
"queueId": "1EFC92416F0A46DC9BBC08A842B89D93",
"queueName": "Phone Queue",
"arrivalTime": "2019-10-17T13:35:49.773Z",
"disconnectTime": "2019-10-17T13:35:49.780Z",
"totalDuration": 7,
"record": true,
"script": true
},
{
"id": "336FFFD5C6FF11E68ACA005056A75D9A",
"contactGroupId": "336FFFD4C6FF11E68ACA005056A75D9A",
"channel": "CHAT",
"type": "ChatIn",
"typeDetails": "ChatIn Text",
"subtype": "text",
"status": "InProcess",
"statusDetails": "InProcess",
"source": "customer@host.com",
"destination": "chat1@wicom.com",
"agentId": "21A144F1824E4C768868D10201608E2E",
"agentName": "Agent, Name",
"queueId": "1EFC92416F0A46DC9BBC08A842B89D92",
"queueName": "Chat1 (FI)",
"arrivalTime": "2016-12-20T21:56:47.347Z",
"totalDuration": 89048513266,
"subject": "Request for support",
"customerName": "Customer"
},
{
"id": "D469DD256214473E93C3C1C1E8DF3A74",
"contactGroupId": "D469DD256214473E93C3C1C1E8DF3A74",
"channel": "EMAIL",
"type": "EmailIn",
"typeDetails": "EMAILIN",
"status": "InQueue",
"statusDetails": "InProcess",
"source": "from@host.com",
"destination": "email@queue.com",
"queueId": "E09EC850E87F424293B435D22E99BD70",
"queueName": "E-mail Support",
"arrivalTime": "2019-09-08T11:09:14Z",
"totalDuration": 3378644877,
"subject": "Information of the offer"
}
}
Entity representing a contact.
Get the contact with contactId = {contactId}.
get /contacts/{contactId}
Get the contact with contactId = {contactId}.
URI Parameters
- contactId: required(string)
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- id: required(string - minLength: 32 - maxLength: 32)
- contactGroupId: required(string - minLength: 32 - maxLength: 36)
When contact is transferred, then it gets the new id but contactGroupId stays the same. Chats and emails have 36 characters with hyphens, while phone calls have 32 characters without hyphens.
- channel: required(one of PHONE, CHAT, EMAIL)
- type: required(one of CallIn, CallOut, ChatIn, ChatOut, EmailIn, EmailOut)
- typeDetails: required(string)
Original type from Monitoring/Reporting(/Operative) database. Use "type" and "subtype" instead.
- subtype: (one of text, video, sms, facebook, wechat, whatsapp, EMAIL, EMAILOUT, ACTION, TASK, XRI, OII_EMAIL)
Chat or email channel subtype. Chat subtypes in lower case, email subtypes in upper case.
- status: required(one of Pending, InQueue, InProcess, WrapUp, Handled, Abandoned, Deleted)
- statusDetails: required(string)
Original (more detailed) status from Monitoring/Reporting(/Operative) database.
- source: required(string)
Phone number or email address.
- destination: required(string)
Phone number or email address.
- customerName: (string)
Display name of the customer. For chat channel only.
- agentId: (string - minLength: 32 - maxLength: 32)
The agent who is handling or who has handled this contact. Null value not returned - there is no agent.
- agentName: (string)
- queueId: (string - minLength: 32 - maxLength: 32)
The queue in which this contact was created. Null value not returned - there is no queue.
- queueName: (string)
- arrivalTime: required(datetime)
ISO-8601 UTC timestamp in format 2011-12-31T13:15:30.123Z
- disconnectTime: (datetime)
Null if contact is not ended yet.
- totalDuration: required(number)
Milliseconds from arrivalTime to disconnectTime or to current time.
- record: (boolean)
True if contact is phone call and has recording, null otherwise.
- script: (boolean)
True if contact has script, null otherwise.
- subject: (string)
- requiredAgent: (object)
Required or preferred agent if queuing/pending contact has one.
- id: required(string - minLength: 32 - maxLength: 32)
Required/preferred agent ID.
- name: required(string)
Required/preferred agent name.
- type: required(number)
1 if required agent, 2 if preferred agent.
- expirationTime: (datetime)
ISO-8601 UTC timestamp in format 2011-12-31T13:15:30.123Z.
- id: required(string - minLength: 32 - maxLength: 32)
- connectTime: (datetime)
ISO-8601 UTC timestamp in format 2011-12-31T13:15:30.123Z, null if not connected. Provided only if statistics=true is given.
- waitingDuration: (number)
Milliseconds from arrivalTime to connectTime (if connected) or to disconnectTime (if not connected) or to current time (if still in queue). Provided only if statistics=true is given.
- handlingDuration: (number)
Milliseconds from connectTime (if connected) to disconnectTime or to current time (if still in process). Provided only if statistics=true is given.
- wrapUpTotalDuration: (number)
Milliseconds from disconnectTime to wrap-up ended time (not provided) or to current time (if still in wrap-up). Provided only if statistics=true is given.
Example:
{
"id": "DBEC8B07E3F0E9119E1D0050568C5E24",
"contactGroupId": "73CED646FA0947E0AA4E0367FB1B9BCC",
"channel": "PHONE",
"type": "CallIn",
"typeDetails": "IVR",
"status": "Handled",
"statusDetails": "Handled_AOT",
"source": "0505551234",
"destination": "0505550000",
"queueId": "1EFC92416F0A46DC9BBC08A842B89D93",
"queueName": "Phone Queue",
"arrivalTime": "2019-10-17T13:35:49.773Z",
"disconnectTime": "2019-10-17T13:35:49.780Z",
"totalDuration": 7,
"record": true,
"script": true,
"requiredAgent": {
"type": 2,
"expirationTime": "2024-05-05T08:55:24.563Z",
"id": "30BAC5C8C39A4CA5A5B1C5509EE4F12B",
"name": "Surname, First Name"
}
}
Get the remarks for the contact. Remarks is stored in operative database. contactId must be contactGroupId.
Add remarks for the contact. Works only for phone calls, which don't yet have remarks in operative database. Agent needs to be the responsible user for the contact.
Update remarks for the contact. Contact must exist in operative database. Agent needs to be the responsible user for the contact.
get /contacts/{contactId}/remarks
post /contacts/{contactId}/remarks
Add remarks for the contact. Works only for phone calls, which don't yet have remarks in operative database. Agent needs to be the responsible user for the contact.
URI Parameters
- contactId: required(string)
Body
Media type: text/plain
Type: any
Example:
New remarks.
HTTP status code 204
No content - The server has successfully fulfilled the request and there is no additional content to send in the response payload body.
put /contacts/{contactId}/remarks
Update remarks for the contact. Contact must exist in operative database. Agent needs to be the responsible user for the contact.
URI Parameters
- contactId: required(string)
Body
Media type: text/plain
Type: any
Example:
New remarks.
HTTP status code 204
No content - The server has successfully fulfilled the request and there is no additional content to send in the response payload body.
Collection of details.
Get a list of contact events.
get /contacts/{contactId}/details
Get a list of contact events.
URI Parameters
- contactId: required(string)
Query Parameters
- language: (string)
Define with a two-character code (ISO 639) the language to which the translatable values are translated. By default, logged-on user’s language is used.
Example:
language=FI
HTTP status code 200
Body
Media type: application/json
Type: array of object
Items: details
- id: required(string - minLength: 32 - maxLength: 32)
Id of the contact
- event: required(string)
- time: required(datetime)
- value1: required(string)
- value2: (string)
Example:
{
"id": "B887C475B22311D38FBE0090279A922E",
"time": "2016-01-01T12:00:00.000Z",
"event": "Queing",
"value1": "Customer Service",
"value2": ""
},
{
"id": "B888C476B22311D38FBE0090279A922E",
"time": "2016-01-01T12:00:50.000Z",
"event": "DestAllocated",
"value1": "Fox, John",
"value2": "Customer Service"
},
{
"id": "B889C477B22311D38FBE0090279A922E",
"time": "2016-01-01T12:01:00.000Z",
"event": "ConnectedToOper",
"value1": "Fox, John",
"value2": "Customer Service"
},
{
"id": "B890C478B22311D38FBE0090279A922E",
"time": "2016-01-01T12:01:00.000Z",
"event": "DestUnAllocated",
"value1": "Customer Service",
"value2": "Connected"
},
{
"id": "B892C480B22311D38FBE0090279A922E",
"time": "2016-01-01T12:01:00.000Z",
"event": "Disconnected",
"value1": ";0",
"value2": "Customer Service"
}
/contactData
Collection of contactData.
Get data of contact. Attached data is saved for PHONE and CHAT contacts according to configuration.
Adds or updates attached data in JSON format for the given contact. Required fields:
- id - Contact ID. User needs to have MANAGE_CONTACTS right for the contact queue or contact agent (GET requires STATISTICS_DETAILS right). Only phone and chat channels are supported (email is not). Contact must be disconnected (status must be one of: WrapUp, Handled, Abandoned, Deleted).
- attachedData - CAD in JSON format, for example: {"x":0}. Attached data keys are validated to against channel (voice or chat) ExtraDataForHistory parameter. In SC that is called "Extra Data Included in Statistics". ExtraDataForHistory is a comma separated list of allowed keys (if it has * then all keys are allowed).
get /contactData
Get data of contact. Attached data is saved for PHONE and CHAT contacts according to configuration.
Query Parameters
- any fields: (string)
&field1=value1&field2=value2...
Values may contain patterns * and ?
Valid searchable fields: groupId, channel, queueId, userId, customIvrIdExample:
groupId=EB5827A767884A4B91BC4B336F224903*
- creationTime: (string)
Search for contactData that have the creationTime value after the given UTC time
Example:
creationTime=2021-06-29T12:00:00.000Z
- creationTimeEnd: (string)
Search for contactData that have the creationTime value before the given UTC time
Example:
creationTimeEnd=2021-09-29T12:00:00.000Z
- limit: (integer - default: <
>) Limit number of elements by specifying a limit value for the query
Example:
limit=20
HTTP status code 200
Body
Media type: application/json
Type: array of object
Items: contactData
- id: required(string - minLength: 32 - maxLength: 32)
- groupId: (string - minLength: 32 - maxLength: 32)
- creationTime: (datetime)
- channel: (one of PHONE, CHAT)
- attachedData: required(string)
- userId: (string - minLength: 32 - maxLength: 32)
- userName: (string)
- queueId: (string - minLength: 32 - maxLength: 32)
- queueName: (string)
- customIvrId: (string - minLength: 32 - maxLength: 32)
- customIvrName: (string)
Example:
[
{
"id": "207787896927EC11AABA02B4C76E288D",
"groupId": "70FD930E30994CC8A4A6FCEE724DF29A",
"userId": "C189AB2DB65845589F8BB596C7B37536",
"userName": "Agent, Minna2",
"queueId": "01D7221F74F046C6877C61F422689FD5",
"queueName": "Test Phone Queue",
"creationTime": "2021-10-07T12:25:14.467Z",
"channel": "PHONE",
"attachedData": "{\"CustomData\": \"Test\"}"
},
{
"id": "1A7787896927EC11AABA02B4C76E288D",
"groupId": "70FD930E30994CC8A4A6FCEE724DF29A",
"customIvrId": "1026848DCCBE42BE99C5AA4ED628E733",
"customIvrName": "Test Custom IVR",
"creationTime": "2021-10-07T12:24:44.207Z",
"channel": "PHONE",
"attachedData": "{\"CustomData\": \"Test\", \"CustomData2\": \"Test2\"}"
}
]
post /contactData
Adds or updates attached data in JSON format for the given contact. Required fields:
- id - Contact ID. User needs to have MANAGE_CONTACTS right for the contact queue or contact agent (GET requires STATISTICS_DETAILS right). Only phone and chat channels are supported (email is not). Contact must be disconnected (status must be one of: WrapUp, Handled, Abandoned, Deleted).
- attachedData - CAD in JSON format, for example: {"x":0}. Attached data keys are validated to against channel (voice or chat) ExtraDataForHistory parameter. In SC that is called "Extra Data Included in Statistics". ExtraDataForHistory is a comma separated list of allowed keys (if it has * then all keys are allowed).
Query Parameters
- merge: (boolean)
By default the attachedData is merged with possible existing data (merge=true). Old: {"x":0} New: {"y":1} Result: {"x":0, "y":1} If merge=false, then the old data is ignored and only the new data remains.
Example:
merge=false
Body
Media type: application/json
Type: object
Properties- id: required(string - minLength: 32 - maxLength: 32)
- groupId: (string - minLength: 32 - maxLength: 32)
- creationTime: (datetime)
- channel: (one of PHONE, CHAT)
- attachedData: required(string)
- userId: (string - minLength: 32 - maxLength: 32)
- userName: (string)
- queueId: (string - minLength: 32 - maxLength: 32)
- queueName: (string)
- customIvrId: (string - minLength: 32 - maxLength: 32)
- customIvrName: (string)
Example:
Add or update attachedData:
{
"id": "1A7787896927EC11AABA02B4C76E288D",
"attachedData": "{\"CustomData\": \"Test\", \"CustomData2\": \"Test2\"}"
}
Entity representing a contactDatum.
Get the contactData with contactId = {contactId}.
get /contactData/{contactId}
Get the contactData with contactId = {contactId}.
URI Parameters
- contactId: required(string)
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- id: required(string - minLength: 32 - maxLength: 32)
- groupId: (string - minLength: 32 - maxLength: 32)
- creationTime: (datetime)
- channel: (one of PHONE, CHAT)
- attachedData: required(string)
- userId: (string - minLength: 32 - maxLength: 32)
- userName: (string)
- queueId: (string - minLength: 32 - maxLength: 32)
- queueName: (string)
- customIvrId: (string - minLength: 32 - maxLength: 32)
- customIvrName: (string)
Example:
[
{
"id": "207787896927EC11AABA02B4C76E288D",
"groupId": "70FD930E30994CC8A4A6FCEE724DF29A",
"userId": "C189AB2DB65845589F8BB596C7B37536",
"userName": "Agent, Minna2",
"queueId": "01D7221F74F046C6877C61F422689FD5",
"queueName": "Test Phone Queue",
"creationTime": "2021-10-07T12:25:14.467Z",
"channel": "PHONE",
"attachedData": "{\"CustomData\": \"Test\"}"
},
{
"id": "1A7787896927EC11AABA02B4C76E288D",
"groupId": "70FD930E30994CC8A4A6FCEE724DF29A",
"customIvrId": "1026848DCCBE42BE99C5AA4ED628E733",
"customIvrName": "Test Custom IVR",
"creationTime": "2021-10-07T12:24:44.207Z",
"channel": "PHONE",
"attachedData": "{\"CustomData\": \"Test\", \"CustomData2\": \"Test2\"}"
}
]
/messages
Collection of messages.
Get a list of messages.
get /messages
Get a list of messages.
Query Parameters
- any fields: (string)
&field1=value1&field2=value2...
Values may contain patterns * and ?
Valid searchable fields: source, subTypeExample:
source=987654*
- sendTime: (string)
Search for messages that have the sendTime value after the given UTC time
Example:
sendTime=2020-06-29T12:00:00.000Z
- sendTimeEnd: (string)
Search for messages that have the sendTime value before the given UTC time
Example:
sendTimeEnd=2020-07-29T12:00:00.000Z
- creationTime: (string)
Search messages created after the given UTC time
Example:
creationTime=2020-04-29T12:00:00.000Z
- creationTimeEnd: (string)
Search messages created before the given UTC time
Example:
creationTimeEnd=2020-07-29T12:00:00.000Z
HTTP status code 200
Body
Media type: application/json
Type: array of object
Items: messages
- id: required(string - minLength: 32 - maxLength: 32)
Added by the system
- message: required(string - minLength: 1 - maxLength: 2000)
In case of template contentType, use same format as for Reply Templates
- source: required(string)
This must be an existing chat queue address
- subType: required(string)
For example sms, whatsapp, telegram.
- sendTime: (datetime)
ISO-8601 UTC timestamp in format 2020-06-31T13:15:30.123Z.
- creationDate: (datetime)
Added by the system
- maxRetryCount: (integer - default: 5 - maximum: 10)
- retryDelay: (integer - default: 300 - minimum: 60 - maximum: 3600)
Retry delay in seconds
- contentType: (one of text, template - default: text)
- destinations: required(array of object)
Items: items
- address: required(string - minLength: 1 - maxLength: 256)
Phone number of the message recipient
- status: (one of ADDED, PROCESSING, FAILED, HANDLED)
- address: required(string - minLength: 1 - maxLength: 256)
Example:
[
{
"destinations": {
"destination": [
{
"address": "9874572",
"status": "ADDED"
},
{
"address": "9874574",
"status": "ADDED"
} ]
},
"message": "It's time do yearly maintenance for your Mercedes. You can call you us or check free time from web.",
"id": "7709311E00144664847200192C96BFA9",
"creationTime": "2020-06-12T12:36:01.320Z",
"source": "12345678@sms.social365.com",
"subType": "sms",
"sendTime": "2020-06-14T12:36:01.320Z",
"maxRetryCount": 2,
"retryDelay": 3600
},
{
"destinations": {
"destination": [
{
"address": "9874572",
"status": "PROCESSING"
}
]
},
"message": "It's time do yearly maintenance for your Mercedes. You can call you us or check free time from web.",
"id": "7709311E00144664847200192C96BFA9",
"creationTime": "2020-06-12T12:36:01.320Z",
"source": "12345678@whatsapp.social365.com",
"subType": "whatsapp",
"sendTime": "2020-06-14T12:36:01.320Z",
"maxRetryCount": 5,
"retryDelay": 3600
}
]
post /messages
Body
Media type: application/json
Type: object
Properties- id: required(string - minLength: 32 - maxLength: 32)
Added by the system
- message: required(string - minLength: 1 - maxLength: 2000)
In case of template contentType, use same format as for Reply Templates
- source: required(string)
This must be an existing chat queue address
- subType: required(string)
For example sms, whatsapp, telegram.
- sendTime: (datetime)
ISO-8601 UTC timestamp in format 2020-06-31T13:15:30.123Z.
- creationDate: (datetime)
Added by the system
- maxRetryCount: (integer - default: 5 - maximum: 10)
- retryDelay: (integer - default: 300 - minimum: 60 - maximum: 3600)
Retry delay in seconds
- contentType: (one of text, template - default: text)
- destinations: required(array of object)
Items: items
- address: required(string - minLength: 1 - maxLength: 256)
Phone number of the message recipient
- status: (one of ADDED, PROCESSING, FAILED, HANDLED)
- address: required(string - minLength: 1 - maxLength: 256)
Examples:
SMS message with schedule:
{
"destinations": {
"destination": [
{
"address": "+36584215"
},
{
"address": "854125477"
}
]
},
"message": "It's time do yearly maintenance for your Mercedes. You can call you us or check free time from web www.sinch.com",
"source": "12345678@sms.social365.com",
"subType": "sms",
"sendTime": "2020-03-12T12:36:01.320Z",
"maxRetryCount": 2,
"retryDelay": 300
}
WhatsApp template message:
{
"destinations": {
"destination": [
{
"address": "+32542115485"
}
]
},
"message": "{\"template_body\": \"Dear Customer Your Reservation is ready. Please select your method of ticket delivery: Email, Post or WhatsApp\",\"type\": \"template\",\"template_id\": \"buttons_appt\",\"language_code\": \"en\",\"parameters\": {\"body[1]text\": \"Customer\",\"body[2]text\": \"ready\",\"button[0]quick_reply[1]text\": \"button0text\",\"button[1]quick_reply[1]text\": \"button1text\",\"button[2]quick_reply[1]text\": \"button2text\"}}",
"source": "xyz@whatsapp.sinchconversation.com",
"subType": "whatsapp",
"contentType": "template"
}
HTTP status code 201
Returns the created id.
Body
Media type: text/html
Type: any
Example:
F5168FBDD6914C8DB1C6D0BD64563A39
Entity representing a message.
Get the message with messageId = {messageId}.
Update the message with messageId = {messageId}.
Note: Provide all properties since all fields are updated.
Delete the message.
get /messages/{messageId}
Get the message with messageId = {messageId}.
URI Parameters
- messageId: required(string)
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- id: required(string - minLength: 32 - maxLength: 32)
Added by the system
- message: required(string - minLength: 1 - maxLength: 2000)
In case of template contentType, use same format as for Reply Templates
- source: required(string)
This must be an existing chat queue address
- subType: required(string)
For example sms, whatsapp, telegram.
- sendTime: (datetime)
ISO-8601 UTC timestamp in format 2020-06-31T13:15:30.123Z.
- creationDate: (datetime)
Added by the system
- maxRetryCount: (integer - default: 5 - maximum: 10)
- retryDelay: (integer - default: 300 - minimum: 60 - maximum: 3600)
Retry delay in seconds
- contentType: (one of text, template - default: text)
- destinations: required(array of object)
Items: items
- address: required(string - minLength: 1 - maxLength: 256)
Phone number of the message recipient
- status: (one of ADDED, PROCESSING, FAILED, HANDLED)
- address: required(string - minLength: 1 - maxLength: 256)
Example:
{
"destinations": {
"destination": [
{
"address": "9874572",
"status": "ADDED"
},
{
"address": "9874574",
"status": "ADDED"
} ]
},
"message": "It's time do yearly maintenance for your Mercedes. You can call you us or check free time from web.",
"id": "7709311E00144664847200192C96BFA9",
"creationTime": "2020-06-12T12:36:01.320Z",
"source": "12345678@sms.social365.com",
"subType": "sms",
"sendTime": "2020-06-14T12:36:01.320Z",
"maxRetryCount": 2,
"retryDelay": 3600
}
put /messages/{messageId}
Update the message with messageId = {messageId}.
Note: Provide all properties since all fields are updated.
URI Parameters
- messageId: required(string)
Body
Media type: application/json
Type: object
Properties- id: required(string - minLength: 32 - maxLength: 32)
Added by the system
- message: required(string - minLength: 1 - maxLength: 2000)
In case of template contentType, use same format as for Reply Templates
- source: required(string)
This must be an existing chat queue address
- subType: required(string)
For example sms, whatsapp, telegram.
- sendTime: (datetime)
ISO-8601 UTC timestamp in format 2020-06-31T13:15:30.123Z.
- creationDate: (datetime)
Added by the system
- maxRetryCount: (integer - default: 5 - maximum: 10)
- retryDelay: (integer - default: 300 - minimum: 60 - maximum: 3600)
Retry delay in seconds
- contentType: (one of text, template - default: text)
- destinations: required(array of object)
Items: items
- address: required(string - minLength: 1 - maxLength: 256)
Phone number of the message recipient
- status: (one of ADDED, PROCESSING, FAILED, HANDLED)
- address: required(string - minLength: 1 - maxLength: 256)
Example:
{
"destinations": {
"destination": [
{
"address": "9874572"
},
{
"address": "9874574"
}
]
},
"message": "It's time do yearly maintenance for your Mercedes. You can call you us or check free time from web.",
"id": "7709311E00144664847200192C96BFA9",
"creationTime": "2020-06-12T12:36:01.320Z",
"source": "12345678@sms.social365.com",
"subType": "sms",
"sendTime": "2020-06-14T12:36:01.320Z",
"maxRetryCount": 2,
"retryDelay": 3600
}
HTTP status code 204
No content - The server has successfully fulfilled the request and there is no additional content to send in the response payload body.
delete /messages/{messageId}
Delete the message.
/customerConsents
Collection of customerConsents.
Get a list of customerConsents.
Add new or update existing customer consent.
get /customerConsents
Get a list of customerConsents.
Query Parameters
- any fields: (string)
&field1=value1&field2=value2...
Values may contain patterns * and ?
Valid searchable fields: address, usage, consentExample:
usage=recording
HTTP status code 200
Body
Media type: application/json
Type: array of object
Items: customerConsents
- address: required(string)
- usage: required(one of whatsapp, recording)
- consent: required(boolean)
Example:
[
{
"address": "+8541255455",
"usage": "recording",
"consent": true
},
{
"address": "+325154786",
"usage": "whatsapp",
"consent": true
},
{
"address": "+584214777",
"usage": "recording",
"consent": false
}
]
post /customerConsents
Add new or update existing customer consent.
Body
Media type: application/json
Type: object
Properties- address: required(string)
- usage: required(one of whatsapp, recording)
- consent: required(boolean)
Example:
{
"address": "+8541255455",
"usage": "whatsapp",
"consent": true
}
HTTP status code 204
No content - The server has successfully fulfilled the request and there is no additional content to send in the response payload body.
Entity representing a customerConsent.
Get the customerConsent with usage and address {usage}_{address}.
Delete the customerConsent.
get /customerConsents/{usage}_{address}
Get the customerConsent with usage and address {usage}_{address}.
URI Parameters
- usage: required(string)
- address: required(string)
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- address: required(string)
- usage: required(one of whatsapp, recording)
- consent: required(boolean)
Example:
{
"address": "+8541255455",
"usage": "recording",
"consent": true
}
delete /customerConsents/{usage}_{address}
Delete the customerConsent.
URI Parameters
- usage: required(string)
- address: required(string)
/s3attachments
Create a signed link for uploading attachment to S3 bucket and a short url for accessing it
post /s3attachments
Create a signed link for uploading attachment to S3 bucket and a short url for accessing it
Body
Media type: application/json
Type: object
Properties- mimeType: required(string)
Mime type of the attachment
- fileName: required(string)
File name of the attachment
- fileSize: required(number)
Size (bytes) of the attachment
Example:
{
"mimeType": "text/plain",
"fileName": "hii.txt",
"fileSize": 5839
}
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- privateUrlForUpload: (string)
Signed link for uploading the attachment to S3
- shortLink: (string)
Short link unique part for downloading the attachment
- publicUrlForDownload: (string)
Signed link for downloading the attachment (used only when the short link creation failed)
- bucket: (string)
Bucket name
- objectKey: (string)
Object key
Example:
{
"privateUrlForUpload": "https://examplebucketname.s3.eu-west-1.amazonaws.com/1656501194_58f9624f-1f61-4aa9-866e-1ede91984cf1_hii.txt?X-Amz-Security-Token=...",
"shortLink": "Cyh9kJV831",
"publicUrlForDownload": "",
"bucket": "examplebucketname",
"objectKey": "1656501194_58f9624f-1f61-4aa9-866e-1ede91984cf1_hii.txt"
}