Sinch Contact Center Restful Outbound Campaign Interface (OBI) API documentation version v1
http://localhost:8080/RI/obi
Description
This interface provides data of outbound campaings.
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).
/campaigns
Collection of campaigns.
Get a list of campaigns.
get /campaigns
Get a list of campaigns.
Query Parameters
- any fields: (string)
&field1=value1&field2=value2...
Values may contain patterns * and ?
Valid searchable fields: name, dialerId, dialerName, dialingMode, status, dialerStatus, queueId, queueName, customIvrNumber, total, handled, maxCalls, filtered, timeZoneExample:
name=TestCampaign*
- startDate: (string)
Search for campaigns that have the startDate value after the given UTC time
Example:
startDate=2020-06-29T12:00:00.000Z
- startDateEnd: (string)
Search for campaigns that have the startDate value before the given UTC time
Example:
startDateEnd=2020-09-29T12:00:00.000Z
- endDate: (string)
Search for campaigns that have the endDate value after the given UTC time
Example:
endDate=2020-06-29T12:00:00.000Z
- endDateEnd: (string)
Search for campaigns that have the endDate value before the given UTC time
Example:
endDateEnd=2020-09-29T12:00:00.000Z
- registered: (string)
Search for campaigns that have the registered value after the given UTC time
Example:
registered=2020-06-29T12:00:00.000Z
- registeredEnd: (string)
Search for campaigns that have the registered value before the given UTC time
Example:
registeredEnd=2020-09-29T12:00:00.000Z
HTTP status code 200
Body
Media type: application/json
Type: array of object
Items: campaigns
- id: required(string - minLength: 32 - maxLength: 32)
Added by the system
- name: required(string)
- dialerId: required(string - minLength: 32 - maxLength: 32)
- dialerName: (string)
- dialingMode: required(string)
- status: (one of Passive, Active, Handled, Expired, Invalid, Deleted)
- dialerStatus: (one of OPEN, CLOSING, CLOSING2, CLOSED, PASSIVE, COMPLETED, SUSPEND, EXPIRED, SHUTDOWN)
- queueId: required(string - minLength: 32 - maxLength: 32)
- queueName: (string)
- customIvrNumber: (string)
- total: (integer)
- handled: (integer)
- notHandled: (integer)
- maxCalls: (integer)
- filtered: (integer)
- startDate: (datetime)
- endDate: (datetime)
- registered: required(datetime)
- timeZone: (string)
Example:
[
{
"notHandled": 5,
"dialerName": "Queue Dialer",
"total": 10,
"registered": "2020-09-25T07:07:50.243Z",
"dialerId": "88B8B41C99E6484A94F402EA5E465FC5",
"dialer": "88B8B41C99E6484A94F402EA5E465FC5",
"endDate": "2021-02-20T22:00:00Z",
"startDate": "2020-12-20T22:00:00Z",
"handled": 5,
"dialerStatus": "PASSIVE",
"maxCalls": 0,
"filtered": 0,
"dialingMode": "PREDICTIVE",
"name": "Test Campaign",
"timeZone": "Europe/Berlin",
"queueId": "63AA93F493A54C5A8597FCFA670B2382",
"status": "Passive",
"queueName": "Test Queue",
"id": "8A7C98EAF1164F2FAA93B98EECB95D76"
},
{
"notHandled": 5,
"dialerName": "Queue Dialer",
"total": 10,
"registered": "2019-09-25T07:07:50.243Z",
"dialerId": "88B8B41C99E6484A94F402EA5E465FC5",
"dialer": "88B8B41C99E6484A94F402EA5E465FC5",
"handled": 5,
"dialerStatus": "OPEN",
"maxCalls": 0,
"filtered": 0,
"dialingMode": "PREVIEW",
"name": "Test Preview Campaign",
"queueId": "63AA93F493A54C5A8597FCFA670B2382",
"status": "Active",
"queueName": "Test Queue",
"id": "62718C7889CC44F7B944C1A6F6BE9B7F"
}
]
HTTP status code 400
Bad Request
Body
Media type: text/plain
Type: any
Example:
Invalid GUID: '2B8ED95B0EC911E79675005056A75D9'
Entity representing a campaign.
Get the campaign with campaignId = {campaignId}.
get /campaigns/{campaignId}
Get the campaign with campaignId = {campaignId}.
URI Parameters
- campaignId: 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
- name: required(string)
- dialerId: required(string - minLength: 32 - maxLength: 32)
- dialerName: (string)
- dialingMode: required(string)
- status: (one of Passive, Active, Handled, Expired, Invalid, Deleted)
- dialerStatus: (one of OPEN, CLOSING, CLOSING2, CLOSED, PASSIVE, COMPLETED, SUSPEND, EXPIRED, SHUTDOWN)
- queueId: required(string - minLength: 32 - maxLength: 32)
- queueName: (string)
- customIvrNumber: (string)
- total: (integer)
- handled: (integer)
- notHandled: (integer)
- maxCalls: (integer)
- filtered: (integer)
- startDate: (datetime)
- endDate: (datetime)
- registered: required(datetime)
- timeZone: (string)
Example:
{
"notHandled": 5,
"dialerName": "Queue Dialer",
"total": 10,
"registered": "2020-09-25T07:07:50.243Z",
"dialerId": "88B8B41C99E6484A94F402EA5E465FC5",
"dialer": "88B8B41C99E6484A94F402EA5E465FC5",
"endDate": "2021-02-20T22:00:00Z",
"startDate": "2020-12-20T22:00:00Z",
"handled": 5,
"dialerStatus": "PASSIVE",
"maxCalls": 0,
"filtered": 0,
"dialingMode": "PREDICTIVE",
"name": "Test Campaign",
"timeZone": "Europe/Berlin",
"queueId": "63AA93F493A54C5A8597FCFA670B2382",
"status": "Passive",
"queueName": "Test Queue",
"id": "8A7C98EAF1164F2FAA93B98EECB95D76"
}
HTTP status code 404
Not Found
Body
Media type: text/plain
Type: any
Example:
HTTP 404 Not Found
Value can be one of Passive, Active.
put /campaigns/{campaignId}/status
Value can be one of Passive, Active.
URI Parameters
- campaignId: required(string)
Body
Media type: text/plain
Type: string
Example:
Active
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 customers.
Get a list of customers.
Add a new customer.
get /campaigns/{campaignId}/customers
Get a list of customers.
URI Parameters
- campaignId: required(string)
Query Parameters
- includeScript: (string - default: false)
includes script to result
Example:
includeScript=true
- any fields: (string)
&field1=value1&field2=value2...
Values may contain patterns * and ?
Valid searchable fields: externalId, numbers, result, callResult, classifier, callCount, lastBNumber, agentId, dialingMode, previewTime, priority, timeZoneExample:
callResult=SUCCESS*
- date: (string)
Search for customers that have the date value after the given UTC time
Example:
date=2020-06-29T12:00:00.000Z
- dateEnd: (string)
Search for customers that have the date value before the given UTC time
Example:
dateEnd=2020-07-29T12:00:00.000Z
- modificationDate: (string)
Search for customers that have the modificationDate value after the given UTC time
Example:
modificationDate=2020-04-29T12:00:00.000Z
- modificationDateEnd: (string)
Search for customers that have the modificationDate value before the given UTC time
Example:
modificationDateEnd=2020-07-29T12:00:00.000Z
- attributeName: (string)
Search item by attribute name.
Example:
attributeName=classification
- attributeValue: (string)
Search by value of the attribute, attributeName parameter is mandatory in case attributeValue is given.
Example:
attributeValue=gold
HTTP status code 200
Body
Media type: application/json
Type: array of object
Items: customers
- id: required(string - minLength: 32 - maxLength: 32)
Added by the system
- externalId: required(string)
- numbers: required(string)
- result: (string)
- callResult: (string)
- classifier: (string)
- callCount: (integer)
- lastBNumber: (integer)
- date: (datetime)
- agentId: (string)
- dialingMode: (one of PREVIEW, PREDICTIVE)
- previewTime: (integer)
- priority: (integer)
- modificationDate: (datetime)
- timeZone: (string)
- attributes: (array of object)
Items: items
- name: required(string)
- value: required(string)
- script: (object)
- name: required(string)
- answers: required(array of object)
Items: items
- question: required(string)
- answer: required(string)
Example:
[{
"attributes": {
"attribute": [
{
"name": "City",
"value": "New York"
},
{
"name": "Classification",
"value": "Gold"
},
{
"name": "Address",
"value": "StreetAddress10"
},
{
"name": "First Name",
"value": "Kathy"
},
{
"name": "Phone1",
"value": "0215428754"
}
]
},
"script": {
"answers": [
{
"answer": "Other",
"question": "If you would now buy a new tennis racket, which of the following brands would you prefer?
},
{
"answer": "yes",
"question": "Would you be interested to visit our store so we can book an expert to introduce you these rackets in more details?"
},
{
"answer": "Within 6 months",
"question": "OK. When do you think you are going to update your racket so we can give you an call to discuss what we can offer at that time?"
}
],
"name": "Tennis Sales Script"
},
"result": "SUCCESS",
"date": "9999-12-31T23:59:59Z",
"dialingMode": "PREDICTIVE",
"lastBNumber": 0,
"callCount": 0,
"modificationDate": "2020-09-29T12:58:28.393Z",
"externalId": "10",
"numbers": "0215428754",
"id": "5C7A1B1A001848B7A86000E10E3B9D5B"
},
{
"attributes": {
"attribute": [
{
"name": "City",
"value": "New York"
},
{
"name": "ExternalId",
"value": "7"
},
{
"name": "Classification",
"value": "Gold"
},
{
"name": "Postcode",
"value": "10001"
},
{
"name": "Company",
"value": "HighCom"
},
{
"name": "Address",
"value": "StreetAddress7"
},
{
"name": "First Name",
"value": "Julie"
},
{
"name": "Phone1",
"value": "951254875"
},
{
"name": "Phone2",
"value": "951254875"
}
]
},
"result": "SUCCESS",
"date": "9999-12-31T23:59:59Z",
"lastBNumber": 0,
"callCount": 0,
"modificationDate": "2020-09-29T12:58:28.393Z",
"externalId": "7",
"numbers": "951254875;951254875",
"id": "3B3BAFB4FD1444478DBF0658EDF389CC"
}
}]
HTTP status code 400
Bad Request
Body
Media type: text/plain
Type: any
Example:
Invalid GUID: '2B8ED95B0EC911E79675005056A75D9'
post /campaigns/{campaignId}/customers
Add a new customer.
URI Parameters
- campaignId: required(string)
Body
Media type: application/json
Type: object
Properties- id: required(string - minLength: 32 - maxLength: 32)
Added by the system
- externalId: required(string)
- numbers: (string)
Customer's phone numbers separated with semicolon (;). Customer can have up-to 3 numbers. You can define customer phone numbers either by using this field, or by specifying attributes attributes Phone1, Phone2 and Phone3. Note: in case numbers is given, the attributes are ignored. It is required to provide phone numbers either by this property or by attributes.
- date: (datetime)
- agentId: (string)
- dialingMode: (one of PREVIEW, PREDICTIVE)
- previewTime: (integer)
- priority: (integer)
- modificationDate: (datetime)
- timeZone: (string)
- attributes: (array of object)
Attributes of the customer. Note: attributes Phone1, Phone2 and Phone3 are created based on numbers property if that is defined in data. If numbers is not specified, it is mandatory to have at least attribute Phone1.
Items: items
- name: required(string)
- value: required(string)
Example:
{
"attributes": {
"attribute": [
{
"name": "City",
"value": "New York"
},
{
"name": "Classification",
"value": "Gold"
},
{
"name": "Address",
"value": "StreetAddress10"
},
{
"name": "First Name",
"value": "Kathy"
}
]
},
"externalId": "10",
"numbers": "0215428754;98521542",
"timeZone": "Europe/Helsinki"
}
}
HTTP status code 201
Returns the created id.
Body
Media type: text/html
Type: any
Example:
F5168FBDD6914C8DB1C6D0BD64563A39
Entity representing a customer.
Get the customer with customerId = {customerId}.
Delete the customer.
get /campaigns/{campaignId}/customers/{customerId}
Get the customer with customerId = {customerId}.
URI Parameters
- campaignId: required(string)
- customerId: 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
- externalId: required(string)
- numbers: required(string)
- result: (string)
- callResult: (string)
- classifier: (string)
- callCount: (integer)
- lastBNumber: (integer)
- date: (datetime)
- agentId: (string)
- dialingMode: (one of PREVIEW, PREDICTIVE)
- previewTime: (integer)
- priority: (integer)
- modificationDate: (datetime)
- timeZone: (string)
- attributes: (array of object)
Items: items
- name: required(string)
- value: required(string)
- script: (object)
- name: required(string)
- answers: required(array of object)
Items: items
- question: required(string)
- answer: required(string)
Example:
{
"attributes": {
"attribute": [
{
"name": "City",
"value": "New York"
},
{
"name": "Classification",
"value": "Gold"
},
{
"name": "Address",
"value": "StreetAddress10"
},
{
"name": "First Name",
"value": "Kathy"
},
{
"name": "Phone1",
"value": "0215428754"
}
]
},
"script": {
"answers": [
{
"answer": "Other",
"question": "If you would now buy a new tennis racket, which of the following brands would you prefer?
},
{
"answer": "yes",
"question": "Would you be interested to visit our store so we can book an expert to introduce you these rackets in more details?"
},
{
"answer": "Within 6 months",
"question": "OK. When do you think you are going to update your racket so we can give you an call to discuss what we can offer at that time?"
}
],
"name": "Tennis Sales Script"
},
"result": "SUCCESS",
"date": "9999-12-31T23:59:59Z",
"dialingMode": "PREDICTIVE",
"lastBNumber": 0,
"callCount": 0,
"modificationDate": "2020-09-29T12:58:28.393Z",
"externalId": "10",
"numbers": "0215428754",
"id": "5C7A1B1A001848B7A86000E10E3B9D5B"
}
HTTP status code 404
Not Found
Body
Media type: text/plain
Type: any
Example:
HTTP 404 Not Found
delete /campaigns/{campaignId}/customers/{customerId}
Delete the customer.
URI Parameters
- campaignId: required(string)
- customerId: required(string)