@(udesk)[CTI|API|CTI CLOUD]
General Specifications
Request Format
Base URL
https://{host}/{Type}/{version}/{api}?Timestamp={Timestamp}&AppId={AppId}
- host: The API domain name.
- Type:
ccapi
- version: The API version, currently
v2
.
- api: See the specific API URI.
- Timestamp: UTC timestamp, accurate to the millisecond.
- AppId: A UUID string used to specify which APP to operate on, required for all operations except creating an APP.
Note: The IP and port (port number) in the example are project-related. Please contact the pre-sales or after-sales manager for confirmation.
HTTP Header
- Accept:
"application/json"
- Content-Type:
"application/json;charset=utf-8"
HTTP METHOD
- GET (SELECT): Retrieve resources (one or more) from the server.
- POST (CREATE): Create a new resource on the server.
- PUT (UPDATE): Update a resource on the server (the client provides the complete resource with changes).
- PATCH (UPDATE): Update a resource on the server (the client provides the attributes that have changed).
- DELETE (DELETE): Delete a resource from the server.
HTTP Status Code
- 200 OK - [GET]: The server successfully returned the data requested by the user, and this operation is idempotent.
- 201 CREATED - [POST/PUT/PATCH]: The user successfully created or modified data.
- 202 Accepted - [*]: Indicates that a request has entered the background queue (asynchronous task)
- 204 NO CONTENT - [DELETE]: The user successfully deleted data.
- 400 INVALID REQUEST - [POST/PUT/PATCH]: The request made by the user has errors, and the server did not perform any new or modified data operations, and this operation is idempotent.
- 401 Unauthorized - [*]: Indicates that the user does not have permission (token, username, password error).
- 403 Forbidden - [*] Indicates that the user is authorized (opposite to 401 error), but access is forbidden.
- 404 NOT FOUND - [*]: The request made by the user is for a non-existent record, and the server did not perform any operations, and this operation is idempotent.
- 406 Not Acceptable - [GET]: The format requested by the user is not available (for example, the user requests JSON format, but only XML format is available).
- 410 Gone - [GET]: The resource requested by the user has been permanently deleted and will not be obtained again.
- 422 Unprocessable Entity - [POST/PUT/PATCH] When creating an object, a validation error occurs.
- 500 INTERNAL SERVER ERROR - [*]: An error occurred on the server, and the user will not be able to determine if the request was successful.
Response Format
General
- Responses are in UTF-8 encoded JSON format.
- See [Response Codes](Response Codes.md) for response codes.
Correct Response Format
{
"ErrCode": "000000", // Response code (required)
"ErrDesc": "OK", // Response description (required)
"Result": {
// Data...
}
}
Error Response Format
{
"ErrCode": "000001", // Response code (required)
"ErrDesc": "Parameter error", // Response description (required)
"Result": {
// Data...
}
}
WebSocket Message Format
Request Message Standard Header
{
"Ver": "1.0", // Protocol version number
"UA": "Chrome 62;uvcsdk-js-1.0", // Optional, <browser or mobile operation>;<SDK>
"SeqId": 1, // Sequence ID, defined by the message sender, incrementally ordered. The response sequence ID is the same as the sent sequence ID
"MsgId": "uuid", // Message ID, a unique identifier for each message, defined by the message sender. The response message ID is the same as the sent message ID
"MsgType":"REQ", // Request message: REQ
"AppId": "f781fd92-9e96-4195-7a7e-257307edb4ad",
"AgentId": "1443",
"Timestamp": 1511069652789, // UTC timestamp, accurate to the millisecond
}
Response Message Standard Header
{
"Ver": "1.0", // Protocol version number
"SeqId": 1, // The response sequence ID is the same as the sent sequence ID
"MsgId": "uuid", // The response message ID is the same as the sent message ID
"MsgType":"REP", // Response message: REP
"Timestamp": 1511070594789, // UTC timestamp, accurate to the millisecond
"ErrCode": "000000", // Success: 000000,
"ErrDesc": "OK", // Error description, success is: OK
}
Notification Message Standard Header
Notification messages do not require a response
{
"Ver": "1.0", // Protocol version number
"SeqId": 1, // Sequence ID, defined by the message sender, incrementally ordered. The response sequence ID is the same as the sent message ID
"MsgId": "uuid", // Message ID, a unique identifier for each message, defined by the message sender. The response message ID is the same as the sent message ID
"MsgType":"NTF", // Notification message: NTF
"Timestamp": 1511069652789, // UTC timestamp, accurate to the millisecond
}
Event Message Standard Header
Event messages require an evtAck response
{
"Ver": "1.0", // Protocol version number
"SeqId": 1, // Sequence ID, defined by the message sender, incrementally ordered. The response message ID is the same as the sent message ID
"MsgId": "uuid", // Message ID, a unique identifier for each message, defined by the message sender. The response message ID is the same as the sent message ID
"MsgType":"EVT", // Event message: EVT
"Timestamp": 1511069652789, // UTC timestamp, accurate to the millisecond
}
Event Response Message
{
"Ver": "1.0", // Protocol version number
"SeqId": 1, // Sequence ID. The response sequence ID is the same as the sent sequence ID
"MsgId": "uuid", // Message ID, a unique identifier for each message, the response message ID is the same as the sent message ID
"MsgType":"ACK", // Event response message: ACK
"Timestamp": 1511069652789, // UTC timestamp, accurate to the millisecond
"Method": "{EvtMethod}"
}
Data Format Conventions
PSTN Numbers
- Landline format:
0{area code}{local number}
- Mobile format:
{11-digit mobile number}
- International number:
00{international country code}{national area code}{local number}
- Agent SIP number:
{company number prefix}{agent extension number}
- Company number prefix:
9{9 digits}
- Agent extension number:
{4 digits}
Examples
"01067654637" # Landline number
"13676546374" # Mobile number
Extension Numbers
- Four-digit number starting with a non-zero digit:
[1-9]\d{3}
Example
"8001" # Extension number
Queue ID (QueueId)
- 4-digit number starting with 9:
9\d{3}
Agent ID (AgentId)
- Digits:
\d+
- Maximum length: 32 characters
Agent Work Number (WorkId)
- Digits or characters:
\w+
- Maximum length: 32 characters
Timestamp (Timestamp)
- Uses UTC time
- Format: Unix Time, which is the number of milliseconds since "1970-01-01 00:00:00.000".
Authentication Methods
Server-Side API Authentication
- All interfaces use HTTPS encryption
- Sign:
SHA1(Sid + AuthToken + Timestamp)
- Sid: Account
- AuthToken: Authentication token
- Timestamp: Timestamp, valid within 10 minutes, in milliseconds
Parameters (URL Query String)
- Timestamp
- AppId
- Sid
- Sign
Example
GET request
curl https://xxx.udesk.cn/ccapi/v2/agents?Timestamp=1519468251&AppId=6f142ddb-47ed-442e-83e7-6d2574d77aa2&Sid=1234567890&Sign=9416b06a42d56dc3be412fa084e787dba52a2769
Front-End API Authentication
- All interfaces use HTTPS encryption
- The front end needs to request Sign from the business server
- The method for the business server to calculate the front-end Sign:
SHA1(AgentId + AuthToken + Timestamp)
- Parameters (URL Query String)
- Timestamp: Timestamp, valid within 10 minutes
- AgentId: Agent ID
- AuthToken: Authentication token
Example
https://xxx.udesk.cn/ccapi/v2/agents?Timestamp=1519468251&AppId=6f142ddb-47ed-442e-83e7-6d2574d77aa2&AgentId=8001&Sign=9416b06a42d56dc3be412fa084e787dba52a2769
WebSocket Authentication
Server-Side API Documentation
Application Management
Create Application
URL: apps
METHOD: POST
Notes
- To call the interface to create an application, you need AppId (generated by the CRM system), Sid (provided by udesk), and AuthToken (provided by udesk). The interface depends on the CRM system and cannot be called separately.
- If you already have AppId and Sid, the call example is as follows
curl {{base_url}}/ccapi/v2/apps?Timestamp={{timestamp}}&AppId={{appid}}&Sign={{sign}}&Sid=123456789abcdef \
-X POST \
-H 'content-type: application/json' \
-d'
{
"Name":"test02",
"Type":1,
"CallbackUrl":""
}
'
- There is an issue with the request parameters below.
- An application is a tenant in the call center platform.
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
Name | Y | string | Application name |
Type | Y | integer | Application type, Call Center Platform: 1, Telemarketing Platform: 0 |
CallbackUrl | Y | string (url) | Server callback URL |
IsHideUserNum | N | boolean | Hide user number on agent extension, default: False |
Memo | N | string | Description |
Notes | | | |
- When calling the interface to create an application, the request parameter does not require AppId, as the application has not been created yet and there is no AppId. This is the only API interface that does not require AppId as a request parameter.
Return Results
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Result | object | As follows |
Result | | |
Parameter Name | Type (Format) | Description |
---|
AppId | string (uuid) | Unique application ID |
ExtensionPrefix | string | Agent extension prefix |
Name | string | Application name |
Memo | string | Application description |
Type | string | Application type |
CallbackUrl | string | Callback URL |
IsHideUserNum | string | Hide user number on agent extension |
Secret | string | Application secret |
WrapUpTime | string | Wrap-up time |
Update Application
URL: apps
METHOD: PUT
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
Name | N | string | Application name |
Type | N | string (enum) | Application type, values: default or external, default: default |
CallbackUrl | N | string (url) | Server callback URL |
IsHideUserNum | N | boolean | Hide user number on agent extension |
Memo | N | string | Description |
Return Results
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Get Application Details
URL: apps
METHOD: GET
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
Return Results
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Result | object | As follows |
Result
Parameter Name | Type (Format) | Description |
---|
AppId | string (uuid) | Application ID |
Name | string | Application name |
Type | string (enum) | Application type, default or external |
CallbackUrl | string (url) | Server callback URL |
IsHideUserNum | boolean | Hide user number on agent extension |
Secret | string | Application secret |
Memo | string | Application description (optional) |
Relay Number Management
Selection strategy for relay numbers during outbound calls:
- Prioritize specified relay numbers for outbound calls.
- Secondly, the default relay number for the agent.
- Then, the company's default relay number.
- Finally, the system randomly selects a number.
Get Relay Number List
URL: spnumbers
METHOD: GET
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
Return Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Result | object | As follows |
Result | | |
Parameter Name | Type (Format) | Description |
---|
SpNumbers | [string (uuid)] | Relay number list |
DefSpNumber | string (digits) | Currently configured default relay number |
Update Default Relay Number
URL: spnumbers/default
METHOD: PUT
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
DefSpNumber | N | string | Default relay number, can be any number in the relay number list |
Note: For POST and PUT methods, other parameters (e.g., DefSpNumber in the Update Default Relay Number interface) in addition to url parameters and authentication parameters should be passed through the request body. | | | |
Return Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Request Example | | |
curl 'http://ip:port/ccapi/v2/spnumbers/default/7763?Timestamp=1566540424&AppId=a54a8b77-f12d-4ac9-742d-5b2bef5c4d11&Sid=123456789abcdef&Sign=de3fec40c8671bcbab00b12e5254e378a53f646a' \
-X PUT \
-d '{"DefSpNumber" : "057126200670"}'
Delete Default Relay Number
URL: spnumbers/default
METHOD: DELETE
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
Return Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Request Example | | |
curl 'http://ip:port/ccapi/v2/spnumbers/default/7763?Timestamp=1566540424&AppId=a54a8b77-f12d-4ac9-742d-5b2bef5c4d11&Sid=123456789abcdef&Sign=de3fec40c8671bcbab00b12e5254e378a53f646a' -X DELETE
Modify Agent's Default Relay Number
URL: /spnumbers/agent/default/:agentId
METHOD: PUT
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
DefSpNumber | N | string | Default relay number, can be any number in the relay number list |
Return Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Delete Agent's Default Relay Number
URL: /spnumbers/agent/default/:agentId
METHOD: DELETE
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
Return Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Seat Management
Create Seat
URL: agents
METHOD: POST
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | string | Timestamp |
AppId | Y | string (UUID) | Application ID |
Agents | Y | array (Seat Object) | List of seats |
Seat Object | | | |
Parameter Name | Required | Type (Format) | Description |
---|
AgentId | Y | string (digits) | Seat ID |
WorkId | Y | string (digits) | Seat job number |
Name | N | string | Seat name |
Mobile | N | string (phone) | Seat mobile number |
Email | N | string (Email) | Seat Email |
Role | N | string (enum) | Can be agent, leader, default is agent |
Enable | N | boolean | true: enable, default is enabled |
IsCreateExtension | N | boolean | Create and bind seat extension |
Response Result | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Result | object | If binding extension at the same time, as follows |
Result | | |
Parameter Name | Type (Format) | Description |
---|
Extensions | [Extension] | List of extension numbers, as follows |
Extensions | | |
Parameter Name | Type (Format) | Description |
---|
Extension | string (digits) | Extension number |
Password | string | Extension password |
Request Example | | |
curl -X POST 'http://ip:port/ccapi/v2/agents?Timestamp=1566446286&AppId=802411d4-2fb5-46ae-422f-d33de0059c47&Sign=891462f08d113b0b1285e985ff7a7c56ba42a18f&Sid=123456789abcdef' -d '{\"Agents\":[{\"AgentId\":\"199\",\"WorkId\":\"199\",\"Name\":\"Li\",
\"Mobile\":\"18512520714\",\"Email\":\"123@qq.com\",\"Role\":\"agent\",\"Extension\":\"2457\",\"WrapUpTime\":0},{\"AgentId\":\"200\",\"WorkId\":\"200\",\"Name\":\"Qian\",\"Mobile\":\"18512520714\",\"Email\":\"456@qq.com\",\"Role\":\"agent\",\"Extension\":\"2458\",\"WrapUpTime\":1}]}'
Response Example
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": null
}
Update Seat
URL: agents/{AgentId}
METHOD: PUT
Note: "{AgentId}" represents the URL parameter.
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | string | Timestamp |
AppId | Y | string (UUID) | Application ID |
AgentId | Y | string (digits) | Seat ID |
WorkId | Y | string (digits) | Seat job number |
Name | N | string | Seat name |
Mobile | N | string (phone) | Seat mobile number |
Email | N | string (Email) | Seat Email |
Role | N | string (enum) | Can be agent, leader, default is agent |
Enable | N | boolean | true: enable, false: disable, default: true |
Response Result | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Request Example | | |
curl 'http://ip:port/ccapi/v2/agents/7763?Timestamp=1566540424&AppId=a54a8b77-f12d-4ac9-742d-5b2bef5c4d11&Sid=123456789abcdef&Sign=de3fec40c8671bcbab00b12e5254e378a53f646a' \
-X PUT \
-d '{
"AgentId": "10030",
"WorkId": "22024",
"Name": "test 5",
"Mobile": "17777773333",
"Email": "5544@qq.com",
"Role": "agent"
}
'
Note: AgentId must be passed in both the URL and the request body.
Response Example
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": null
}
Seat Login
URL: agent/login
METHOD: POST
Note: The seat must be bound to an extension before logging in.
Request Parameters
Parameter Name | Type (Format) | Required | Description |
---|
agent_Id | string (digits) | Y | Seat ID |
WorkerID | string (digits) | N | Seat job number |
QueueIDs | [string (digits)] | N | Array of queue identifiers |
Number | string (digits) | N | Seat contact information, PSTN number or VOIP account |
State | string (digits) | N | |
MsgId | string | N | Timestamp |
Response Result | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
msg_id | string | The MsgId sent during login |
result | string | Nonsensical |
data | nil | Nonsensical |
Request Example | | |
curl -X POST 'http://ip:port/ccapi/v2/agent/login?Timestamp=1566554019&AppId=d30fe35c-995d-4921-55b8-ad21b476bbb8&Sign=597ba974a48f49ca8ae95eee2d725a5bf6211520&Sid=123456789abcdef&MsgId=123456789' -d ' { "agent_Id": "10032" }'
Response Example
{
"ErrCode": "000000",
"ErrDesc": "OK",
"msg_id": "123456789",
"results": "",
"data": null
}
Seat Logout
URL: agent/logout
METHOD: POST
Request Parameters
Parameter Name | Type (Format) | Required | Description |
---|
agent_Id | string (digits) | Y | Seat ID |
Note: In the request URL, the application ID is "app_id", which is different from the previous "AppId". | | | |
Response Result | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Request Example | | |
curl -X POST 'http://ip:port/ccapi/v2/agent/logout?Timestamp=1566554019&app_id=d30fe35c-995d-4921-55b8-ad21b476bbb8&Sign=597ba974a48f49ca8ae95eee2d725a5bf6211520&Sid=123456789abcdef&MsgId=123456789' -d '{"agent_Id":"10032"}'
Response Example
{
"ErrCode": "000000",
"ErrDesc": "OK",
"msg_id": "123456789",
"results": "",
"data": null
}
Delete Seat
URL: agents/{AgentId}
METHOD: DELETE
Request Parameters
Parameter Name | Type (Format) | Required | Description |
---|
Timestamp | number (Timestamp) | Y | Timestamp |
AppId | string (UUID) | Y | Application ID |
AgentId | string (digits) | Y | Seat ID, numeric |
IsDelExtensions | boolean | N | Whether to delete the bound extensions at the same time, "true" - delete all extensions bound to the seat; "false" (default) - do not delete extensions bound to the seat |
Response Result | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Request Example | | |
curl -X DELETE 'http://ip:port/ccapi/v2/agents/7777?Timestamp=1566446286&AppId=a54a8b77-f12d-4ac9-742d-5b2bef5c4d11&Sign=891462f08d113b0b1285e985ff7a7c56ba42a18f&Sid=123456789abcdef' -d '{"AgentId":"7777"}'
Response Example
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": null
}
Get Seat Details
URL: agents/{AgentId}
METHOD: GET
Note: AgentId is a URL parameter.
Request Parameters
Parameter Name | Type (Format) | Required | Description |
---|
Timestamp | number (Timestamp) | Y | Timestamp |
AppId | string (UUID) | Y | Application ID |
AgentId | string (digits) | Y | Seat ID, numeric |
Note: AgentId must be passed in both the URL and the request body. | | | |
Response Result | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Result | object | As follows |
Result | | |
Parameter Name | Type (Format) | Description |
---|
AppId | string | Application ID |
AgentId | string (digits) | Seat ID |
WorkId | string (digits) | Seat job number |
Name | string | Seat name |
Mobile | string (phone) | Seat mobile number |
Email | string (Email) | Seat Email |
Role | string (enum) | Can be agent, leader, default is agent |
Queues | [string (digits)] | List of queues bound to the seat (array) |
QueuesNames | string | Names of queues bound to the seat |
Extensions | [Extension] | List of extensions bound to the seat (array) |
DefSpNumber | [string (digits)] | Default trunk number for the seat |
State | enum | Seat state (refer to the State enum values below ) |
ExtState | enum | Extension state (refer to the ExtState enum values below ) |
WrapUpTime | Integer | Wrap-up time, in seconds |
Enable | boolean | true: enabled, false: disabled, default: true |
ExtenInfos | string | Extension information |
State Enum Values | | |
Value | Meaning |
---|
0 | Ready |
1 | Ready for work |
2 | Locked |
3 | In call |
4 | Not available |
ExtState Enum Values | |
Value | Meaning |
---|
0 | Extension Idle |
1 | Extension Busy |
2 | Extension Online |
3 | Extension Offline |
4 | Extension Invalid |
Request Example | |
curl 'http://ip:port/ccapi/v2/agents/7765?Timestamp=1566446286&AppId=a54a8b77-f12d-4ac9-742d-5b2bef5c4d11&Sign=891462f08d113b0b1285e985ff7a7c56ba42a18f&Sid=123456789abcdef' -d '{"AgentId":"7765"}'
Response Example
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": {
"AppId": "a54a8b77-f12d-4ac9-742d-5b2bef5c4d11",
"AgentId": "7765@a54a8b77-f12d-4ac9-742d-5b2bef5c4d11",
"WorkId": "7765",
"Name": "",
"Mobile": "",
"Email": "",
"Role": "agent",
"Queues": null,
"Extensions": null,
"DefSpNumber": "",
"State": 4,
"ExtState": 3,
"WrapUpTime": 0,
"Enable": true
}
}
Get Seat List
URL: agents
METHOD: GET
Request Parameters
Parameter Name | Required | Description |
---|
Timestamp | Y | Timestamp |
AppId | Y | Application ID |
Response Result | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Result | object | As follows |
Result | | |
Parameter Name | Type (Format) | Description |
---|
CurrPage | Integer | Current page number |
PageSize | Integer | Number of records per page |
Total | Integer | Total number of records |
TotalPage | Integer | Total number of pages |
AgentList | object | Seat list, as follows |
AgentList | | |
Parameter Name | Type (Format) | Description |
---|
AppId | string | Application ID |
AgentId | string (digits) | Seat ID |
WorkId | string (digits) | Seat job number |
Name | string | Seat name |
Mobile | string (phone) | Seat mobile number |
Email | string (Email) | Seat Email |
Role | string (enum) | Can be agent, leader, default is agent |
Queues | [string (digits)] | List of queues bound to the seat (array) |
QueuesNames | string | Names of queues bound to the seat |
Extensions | [Extension] | List of extensions bound to the seat (array) |
DefSpNumber | [string (digits)] | Default trunk number for the seat |
State | enum | Seat state (refer to the State enum values below ) |
ExtState | enum | Extension state (refer to the ExtState enum values below ) |
WrapUpTime | Integer | Wrap-up time, in seconds |
Enable | boolean | true: enabled, false: disabled, default: true |
ExtenInfos | string | Extension information |
State Enum Values | | |
Value | Meaning |
---|
0 | Ready |
1 | Ready for work |
2 | Locked |
3 | In call |
4 | Not available |
ExtState Enum Values | |
Value | Meaning |
---|
0 | Extension Idle |
1 | Extension Busy |
2 | Extension Online |
3 | Extension Offline |
4 | Extension Invalid |
Request Example | |
curl 'http://ip:port/ccapi/v2/agents?Timestamp=1566536708&AppId=a54a8b77-f12d-4ac9-742d-5b2bef5c4d11&Sign=2a371cf8c49560671c02116ae54ac1f9ef1e59f3&Sid=123456789abcdef'
Response Example
{
"ErrCode": "000000",
"ErrDesc": "",
"Result": {
"CurrPage": 1,
"PageSize": 439,
"Total": 439,
"TotalPage": 1,
"AgentList": [
{
"AppId": "a54a8b77-f12d-4ac9-742d-5b2bef5c4d11",
"AgentId": "62",
"WorkId": "565",
"Name": "crmtest 2",
"Mobile": "13716429603",
"Email": "crmdianxiao2@test.cn",
"Role": "agent",
"Queues": null,
"QueuesNames": null,
"Extensions": null,
"DefSpNumber": "",
"State": 1,
"ExtState": 0,
"WrapUpTime": 0,
"Enable": true,
"ExtenInfos": null
},
{
"AppId": "a54a8b77-f12d-4ac9-742d-5b2bef5c4d11",
"AgentId": "78",
"WorkId": "",
"Name": "diandiantest",
"Mobile": "13935107603",
"Email": "diandian@test.cn",
"Role": "agent",
"Queues": null,
"QueuesNames": null,
"Extensions": null,
"DefSpNumber": "057126200670",
"State": 1,
"ExtState": 0,
"WrapUpTime": 0,
"Enable": false,
"ExtenInfos": null
}
]
}
}
Seat Extension Binding
URL: agents/extensions
METHOD: POST
Note: A seat can be bound to a maximum of two extension numbers, but only one extension can be used at a time
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
AgentId | Y | string (digits) | Seat ID |
Extensions | Y | [string (digits)] | List of extension numbers (array) |
Note: When passing Extensions, pay attention to the "[]" (brackets) | | | |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Request Example | | |
curl -X POST 'http://ip:port/ccapi/v2/agents/extensions?Timestamp=1566446286&AppId=a54a8b77-f12d-4ac9-742d-5b2bef5c4d11&Sign=891462f08d113b0b1285e985ff7a7c56ba42a18f&Sid=123456789abcdef' -d '
{
"AgentId" : "10031",
"Extensions" : ["2345","9527"]
}
'
Response Example
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": null
}
Seat Extension Unbinding
URL: agents/extensions
METHOD: DELETE
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
AgentId | Y | string (digits) | Seat ID |
Extensions | Y | [string (digits)] | List of extension numbers |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Request Example | | |
curl -X DELETE 'http://ip:port/ccapi/v2/agents/extensions?Timestamp=1566523582&AppId=a54a8b77-f12d-4ac9-742d-5b2bef5c4d11&Sign=f5f8dd0003c1ef1f2bc820a37c0af0dce18ee0fe&Sid=123456789abcdef' -d '
{
"AgentId":"6655",
"Extensions":["2345"]
}
'
Response Example
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": null
}
Seat Queue Binding
URL: agents/queues
METHOD: POST
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
AgentId | Y | string (digits) | Seat ID |
Queues | Y | [string (digits)] | List of Queue IDs |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Request Example | | |
curl -X POST 'http://ip:port/ccapi/v2/agents/queues?Timestamp=1566523582&AppId=a54a8b77-f12d-4ac9-742d-5b2bef5c4d11&Sign=f5f8dd0003c1ef1f2bc820a37c0af0dce18ee0fe&Sid=123456789abcdef' -d '
{
"AgentId" : "10031",
"Queues" : ["9008"]
}
'
Seat Queue Unbinding
URL: agents/queues
METHOD: DELETE
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
AgentId | Y | string (digits) | Seat ID |
Queues | Y | [string (digits)] | Queue IDs |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Request Example | | |
curl -X DELETE 'http://ip:port/ccapi/v2/agents/queues?Timestamp=1566523582&AppId=a54a8b77-f12d-4ac9-742d-5b2bef5c4d11&Sign=f5f8dd0003c1ef1f2bc820a37c0af0dce18ee0fe&Sid=123456789abcdef' -d '
{
"AgentId" : "10031",
"Queues" : ["9008"]
}
'
Queue Management
Create Queue
URL: queues
METHOD: POST
NOTE: A maximum of 100 queues can be created per AppId.
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
QueueId | Y | string (digits) | Queue ID |
QueueName | Y | string | Queue name |
Strategy | N | string (enum) | Queuing strategy, defaults to longest_idle |
Timeout | N | number | Queuing timeout in seconds, defaults to 60 |
MaxLength | N | number | Maximum queue length, defaults to 128, maximum value is 512 |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Request Example | | |
curl -X POST 'http://ip:port/ccapi/v2/queues?Timestamp=1566523582&AppId=a54a8b77-f12d-4ac9-742d-5b2bef5c4d11&Sign=f5f8dd0003c1ef1f2bc820a37c0af0dce18ee0fe&Sid=123456789abcdef' -d '
{
"QueueId":"9009",
"QueueName":"Test Create Queue 007"
}
'
Modify Queue
URL: queues
METHOD: PUT
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
QueueId | Y | string (digits) | Queue ID |
QueueName | Y | string | Queue name |
Strategy | N | string (enum) | Queuing strategy, defaults to longest_idle |
Timeout | N | number | Queuing timeout in seconds, defaults to 0 |
MaxLength | N | number | Maximum queue length, defaults to 128, maximum value is 512 |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Request Example | | |
curl -X PUT 'http://ip:port/ccapi/v2/queues?Timestamp=1566523582&AppId=a54a8b77-f12d-4ac9-742d-5b2bef5c4d11&Sign=f5f8dd0003c1ef1f2bc820a37c0af0dce18ee0fe&Sid=123456789abcdef' -d '
{
"QueueId":"9009",
"QueueName":"Test Create Queue 89757",
"Timeout": 120
}
'
Delete Queue
URL: queues
METHOD: DELETE
NOTE: Queues with bound seats cannot be deleted
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
QueueId | Y | string (digits) | Queue ID |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Request Example | | |
curl -X DELETE 'http://ip:port/ccapi/v2/queues?Timestamp=1566523582&AppId=a54a8b77-f12d-4ac9-742d-5b2bef5c4d11&Sign=f5f8dd0003c1ef1f2bc820a37c0af0dce18ee0fe&Sid=123456789abcdef' -d '{ "QueueId":"9009" }'
Get All Queue Information
URL: queues
METHOD: GET
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Result | object | As follows |
Result | | |
Parameter Name | Type (Format) | Description |
---|
ID | Integer | ID |
CreatedAt | date | Queue creation time |
UpdatedAt | date | Queue update time |
AppID | string | Application ID |
QueueID | string (digits) | Queue ID |
Timeout | number | Queuing timeout in seconds |
Strategy | string (enum) | Queuing strategy |
AgentID | Integer | Seat ID |
Name | string | Queue name |
MaxLength | number | Maximum queue length |
WaitMusic | string | Music to play while queuing |
Get Queue Information (This interface has issues, temporarily ignored)
URL: queues/{QueueId}
METHOD: GET
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Result | object | As follows |
Result | | |
Parameter Name | Type (Format) | Description |
---|
QueueId | string (digits) | Queue ID |
QueueName | string | Queue name |
Strategy | string (enum) | Queuing strategy |
Timeout | number | Queuing timeout in seconds |
MaxLength | number | Maximum queue length |
Agents | [AgentId] | List of seat IDs bound to this queue |
Batch Bind Seats to Queue
URL: queues/agents
METHOD: POST, PUT
Note: Batch binding seats to a queue only creates new records without deleting previous ones.
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
QueueId | Y | string (digits) | Queue ID |
AgentIds | Y | [string (digits)] | List of bound seat IDs (array) |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Request Example | | |
curl -X POST 'http://ip:port/ccapi/v2/queues/agents?Timestamp=1566523582&AppId=a54a8b77-f12d-4ac9-742d-5b2bef5c4d11&Sign=f5f8dd0003c1ef1f2bc820a37c0af0dce18ee0fe&Sid=123456789abcdef' -d '
{
"QueueId":"9008",
"AgentIds":["10031", "10032"]
}
'
Extension Management
Create Extension
URL: extensions
METHOD: POST
Note: The extension password is generated by the system and cannot be set at the time of creation.
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
Extension | Y | string (digits) | Extension number |
Note: The extension number starts with a non-zero digit followed by three digits. | | | |
Response | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Result | object | As follows |
Result | | |
Parameter Name | Type (Format) | Description |
---|
Extension | string (digits) | Extension number |
Password | string | Extension password |
Number | string | Uncertain of its meaning, requires development assistance |
Request Example | | |
$ curl -X POST 'http://ip:port/ccapi/v2/extensions?Timestamp=1566446286&AppId=a54a8b77-f12d-4ac9-742d-5b2bef5c4d11&Sign=891462f08d113b0b1285e985ff7a7c56ba42a18f&Sid=123456789abcdef' -d '{"Extension":"4567"}'
Response Example
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": {
"Extension": "4567",
"Password": "5ca7561e1748f1b7",
"Number": "90310468564567"
}
}
Delete Extension
URL: extensions
METHOD: DELETE
Note: Extensions that are already bound to an agent cannot be deleted.
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
Extension | Y | string (digits) | Extension number |
Response | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Request Example | | |
$ curl -X DELETE 'http://ip:port/ccapi/v2/extensions?Timestamp=1566538172&AppId=a54a8b77-f12d-4ac9-742d-5b2bef5c4d11&Sign=5d97fdd3e55f26a0aea37ca3d03819bf28093038&Sid=123456789abcdef' -d '{"Extension":"4567"}'
Response Example
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": null
}
Switch Phone/Mobile Mode
URL: agent/set_call_mode
METHOD: POST
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
AgentId | Y | string | Agent ID |
Contact | Y | string | Mode, see the Mode List below |
Number | N | string | Number |
MsgId | N | string | Unique ID used to identify local calls |
Mode List | | | |
Mode | Description |
---|
voip | IP Phone |
cellphone | Mobile Phone |
Response | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
msg_id | string | MsgId sent during sign-in |
result | string | No significance |
data | nil | No significance |
Request Example | | |
curl -X POST 'http://ip:port/ccapi/v2/agent/set_call_mode?Timestamp=156655401&AppId=d30fe35c-995d-4921-55b8-ad21b476bbb8&Sign=597ba974a48f49ca8ae95eee2d725a5bf6211520&Sid=123456789abcdef&MsgId=123456789' -d '
{
"AgentId": "10031",
"Contact": "cellphone"
}
'
Response Example
{
"ErrCode": "000000",
"ErrDesc": "OK",
"msg_id": "123456789",
"results": "",
"data": null
}
IVR Configuration Management
Upload IVR Voice File
URL: ivrs/vfiles
METHOD: POST
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
FileName | Y | string | Filename, must be unique |
FileType | N | string | File type, only wav is supported |
FileDesc | N | string | File description |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Delete IVR Voice File
URL: ivrs/vfiles
METHOD: DELETE
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
FileName | Y | string | Filename, must be unique |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Get IVR Voice File List
URL: ivrs/vfiles
METHOD: GET
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Result | object | As follows |
Result | | |
Parameter Name | Type (Format) | Description |
---|
IvrVFiles | [object] | Voice file list, as follows |
IvrVFiles | | |
Parameter Name | Type (Format) | Description |
---|
FileName | string | Filename |
FileType | string | File type |
FileDesc | string | File description |
Set IVR Default Voices
URL: ivrs/defvoices
METHOD: POST, PUT
NOTE: If IVR voices are not configured, the system uses the default configuration.
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
DefVoices | Y | [object] | IVR prompt voices, as follows |
DefVoices | | | |
Parameter Name | Required | Type (Format) | Description |
---|
Welcome | N | object (voice) or "default" | Greeting message |
ClosingTime | N | object (voice) or "default" | Closing time prompt |
NoAnswer | N | object (voice) or "default" | No answer/reject voice |
VoiceMail | N | object (voice) or "default" | Voicemail |
Waiting | N | object (voice) or "default" | Waiting voice |
Consult | N | object (voice) or "default" | Consultation voice |
Hold | N | object (voice) or "default" | Hold voice |
QueueTimeout | N | object (voice) or "default" | Queue timeout voice |
Evaluate | N | object (voice) or "default" | Satisfaction survey voice |
Voice | | | |
Parameter Name | Required | Type (Format) | Description |
---|
Type | Y | string | Type: tts, wav |
Content | Y | string | Content: If Type is tts, the content is tts text; if Type is wav, the content is the filename |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Get IVR Default Voices
URL: ivrs/defvoices
METHOD: GET
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Result | object | As follows |
Result | | |
Parameter Name | Type (Format) | Description |
---|
Voices | [Voice] | IVR prompt voices, refer to “Set IVR Voice Configuration” |
Update Fast Router Configuration
URL: ivrs/fastrouters
METHOD: POST, PUT
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
FastRouter | Y | [object] | Fast router configuration table, as follows |
FastRouter | | | |
Parameter Name | Required | Type (Format) | Description |
---|
Dtmf | Y | string (digit) | Key, 0~9 |
Desc | Y | string | Queue description |
QueueId | Y | string (digits) | Queue ID |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Get Fast Router Configuration
URL: ivrs/fastrouters
METHOD: GET
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
FastRouter | [object] | Fast router configuration table, as follows |
FastRouter | | |
Parameter Name | Type (Format) | Description |
---|
Dtmf | string (digit) | Key, 0~9 |
Desc | string | Queue description |
QueueId | string (digits) | Queue ID |
Creating an Outbound Call
URL: originatev2
METHOD: POST
Note: Some preparation is required to use this interface:
- Have an agent and switch to IP phone mode (mobile mode is also possible, but here we will use IP phone for illustration)
- Have an extension (an example is provided below)
{
"Extension": "8975",
"Password": "d0942c4e07c038f8",
"Number": "90310468568975"
}
- Bind the agent to the extension
- Ensure the agent is in a signed-in state
- Download a softphone, Linphone (a PC software)
- Open the software
- Create a new linphone account
- Use a linphone account
- Username: Number
- SIP domain: 47.94.221.132:5474
- Transport: UDP
- Click "USE"
- In the request body, fill in the relay number (the relay number bound to the agent under the tenant)
- For example, if the relay number is 057126200670, the request body will be:
{
"caller": "057126000000",
"called": "17600000000",
"called_display": "057126000000",
"agent_id": "10032"
}
- Send the request
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number(timestamp) | Timestamp |
AppId | Y | string(uuid) | Application ID |
caller | Y | string | Caller number |
called | Y | string | Called number |
called_display | Y | string | Displayed number |
agent_id | Y | string | Agent ID |
user_data | N | array(associated data object) | Associated data |
Associated Data Object | | | |
Field | Required | Type (Format) | Description |
---|
evt | Y | string | Event type |
data | Y | string | Custom data type |
Response | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string(digits) | Response code |
ErrDesc | string | Response description |
results | string | Call CallID |
Request Example | | |
$ curl 'http://47.94.221.132:8043/ccapi/v2/originatev2?Timestamp=1566446286&AppId=d30fe35c-995d-4921-55b8-ad21b476bbb8&Sign=891462f08d113b0b1285e985ff7a7c56ba42a18f&Sid=123456789abcdef' -d '{\"caller\": \"057128091649\", \"called\": \"15652692674\",\"called_display\":\"057128091649\",\"agent_id\": \"91\", \"user_data\":[{\"evt\": \"user_answer\", \"data\":\"1111111\"}, {\"evt\": \"agent_answer\",\"data\": \"22222\"}]}'
Response Example
{
"ErrCode": "000000",
"ErrDesc": "OK",
"msg_id": "",
"results": "97688e57-7a36-40f7-694a-393d4d1a10d3",
"data": null
}
Outbound Call Control
Hold
URL: /ccapi/v2/agent/hold
METHOD: POST
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
Sid | Y | string | Account |
Sign | Y | string | Signature |
call_id | Y | string | Call ID |
agent_id | Y | string (digits) | Agent ID |
on_succ | Y | string | Fill with any non-empty string |
on_failed | Y | string | Fill with any non-empty string |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
code | string (digits) | Response Code |
message | string | Response Description |
Request Example | | |
curl -X POST 'http://ip:port/ccapi/v2/agent/hold?Timestamp=1585213823&Sign=zxccvb903ef48ef16225e436bb4a3b134567bb6&Sid=100100100100' -d '
{
"call_id":"1a8462d7-00fc-4cc2-4567-038ced6ba580",
"agent_id":"111",
"on_succ":"demo",
"on_failed":"demo"
}'
Response Example
{
"code": "000000",
"message": "OK",
"results": ""
}
Resume
URL: /ccapi/v2/agent/hold
METHOD: DELETE
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
Sid | Y | string | Account |
Sign | Y | string | Signature |
call_id | Y | string | Call ID |
agent_id | Y | string (digits) | Agent ID |
on_succ | Y | string | Fill with any non-empty string |
on_failed | Y | string | Fill with any non-empty string |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
code | string (digits) | Response Code |
message | string | Response Description |
Request Example | | |
curl -X DELETE 'http://ip:port/ccapi/v2/agent/hold?Timestamp=1585214251&Sign=qweasd1bfbac11a829123e63b45fb21b3510abd2&Sid=100100100100' -d '
{
"call_id":"123qwe-00fc-4cc2-a346-038ced6ba580",
"agent_id":"111",
"on_succ":"demo",
"on_failed":"demo"
}'
Response Example
{
"code": "000000",
"message": "OK",
"results": ""
}
Transfer
URL: /ccapi/v2/transfer/agent
METHOD: POST
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
Sid | Y | string | Account |
Sign | Y | string | Signature |
call_id | Y | string | Call ID |
agent_id | Y | string (digits) | Agent ID |
agent_type | Y | string | This parameter must be "anonymous" |
agent_phone | Y | string | Transfer phone number |
on_succ | Y | string | Fill with any non-empty string |
on_failed | Y | string | Fill with any non-empty string |
on_record_over | Y | string | Fill with any non-empty string |
on_transferee_hangup | Y | string | Fill with any non-empty string |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
code | string (digits) | Response Code |
message | string | Response Description |
Request Example | | |
curl -X POST 'http://ip:port/ccapi/v2/transfer/agent?Timestamp=1585214251&Sign=ea4a2b1bfbac11a8299b1bfbac11a829912e63b45fb21b1230abd2&Sid=100100100100' -d '
{
"call_id":"asdfg272-0afb-4136-81bc-328bbcc606c5",
"agent_id":"111",
"agent_type":"anonymous",
"agent_phone":"10010001000",
"on_succ":"demo",
"on_failed":"demo",
"on_record_over":"demo",
"on_transferee_hangup":"demo"
}'
Response Example
{
"code": "000000",
"message": "OK",
"results": ""
}
Auto Dialing Task Management
Start Auto Dialing Task
URL: ads/task/start
METHOD: POST
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
AdTaskId | Y | string | Task ID |
AdTaskType | Y | string | 1 - Precision; 2 - Ratio; 3 - Prediction; 4 - Voice Broadcast; 5 - Robot |
AdTaskRatio | Y | number | 1.0~5.0, Call ratio for ratio dialing, call intensity for prediction dialing |
AdQueueId | N | string | Queue ID corresponding to the task |
AdIvrId | N | string | IVR ID corresponding to the task |
AdRobotToken | N | string | Robot token corresponding to the task |
AdCallerNum | Y | string | Caller number used by the dialing task |
AdDispNum | Y | string | Display number used by the dialing task |
AdConCallLimit | Y | number | Maximum concurrent calls, maximum value 100 |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response Code |
ErrDesc | string | Response Description |
Result | object | As follows |
Result | | |
None | | |
Update Auto Dialing Task Ratio/Intensity
URL: ads/task/update_ratio
METHOD: POST
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
AdTaskId | Y | string | Task ID |
AdTaskRatio | Y | number | 1.0~5.0, Call ratio for ratio dialing, call intensity for prediction dialing |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response Code |
ErrDesc | string | Response Description |
Result | object | As follows |
Result | | |
None | | |
Stop Auto Dialing Task
URL: ads/task/stop
METHOD: POST
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
AdTaskId | Y | string | Task ID |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response Code |
ErrDesc | string | Response Description |
Result | object | As follows |
Result | | |
None | | |
Force Stop Auto Dialing Task
URL: ads/task/force_stop
METHOD: POST
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
AdTaskId | Y | string | Task ID |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response Code |
ErrDesc | string | Response Description |
Result | object | As follows |
Result | | |
None | | |
Get Auto Dialing Task Numbers
URL: cc_ad_task/numbers
METHOD: POST
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
app_id | Y | string (uuid) | Application ID |
ad_task_id | Y | string | Task ID |
count | Y | number | Number of numbers |
Return Results | | | |
Parameter Name | Type (Format) | Description |
---|
code | string (digits) | Response code |
message | string | Response description |
exhausted | boolean | true/false, whether the numbers have been exhausted |
results | [AdNumber] | List of numbers, as follows |
AdNumber | | |
Parameter Name | Type (Format) | Description |
---|
id | string | Number ID |
number | string | Number |
Automatic Dialing Task Stop Notification
URL: cc_ad_task/stop
METHOD: POST
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
app_id | Y | string (uuid) | Application ID |
ad_task_id | Y | string | Task ID |
Return Results | | | |
Parameter Name | Type (Format) | Description |
---|
code | string (digits) | Response code |
message | string | Response description |
Event Subscription
NOTE:
- Event subscription uses the POST method
- The same authentication method as the interface is used
Subscribe to Events
URL: /ccapi/v2/webhooks/events
METHOD: POST to append subscription events,
PUT to replace all events with the ones in the body,
DELETE to remove all events
NOTE: The application layer sends a request to CTI CLOUD to subscribe to events
Pass AppId, Timestamp, sid, and sign in the URL for verification
Request Parameters in the Body
JSON format parameters
Parameter Name | Required | Type (Format) | Description |
---|
Events | Y | [ ]subinfo | List of event names, as follows |
subinfo: | | | |
Parameter Name | Required | Type (Format) | Description |
---|
category | Y | string | Event name, as follows: "agent_state, ext_state, agent_call_mode, call" |
all_type | Y | [ ]string | List of event names, as follows |
events | | | |
- agent_call_mode
"agent_call_mode_change"
- agent_state
"acd_agent_state"
- ext_state
"ext_state"
- call
"agent_breakout",
"agent_interrupt",
"asr_gather_fail",
"asr_gather_succ",
"begin",
"call_notes",
"consult_fail",
"consult_succ",
"dtmf_gather_fail",
"dtmf_gather_succ",
"eavesdrop_fail",
"eavesdrop_succ",
"end",
"end_consult_fail",
"end_consult_succ",
"enqueue_succ",
"extern_succ",
"general_hangup",
"hangup_cause",
"hold_call",
"play_fail",
"play_succ",
"record_stop",
"start_dialout",
"start_ivr",
"substitute_fail",
"substitute_succ",
"three_way_fail",
"three_way_succ",
"transfer_agent_fail",
"transfer_agent_succ",
"user_answer",
"user_hangup",
"user_ringing",
"voice_mail_fail",
"voice_mail_succ"
Call Process Events
Agent Status Change Events
Queue Status Change Events
Recording Events
Return Results
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Message
Message Subscription
URL: subscriptions
METHOD: POST
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
subscriptions | Y | array (subscription) | List of subscription objects |
subscription Message Subscription Object | | | |
Parameter Name | Required | Type (Format) | Description |
---|
callback | Y | string (url) | Callback URL |
name | Y | string | Name of the subscription |
events | Y | [string] | List of subscribed events |
Response Result | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Result | object (sub_result) | Mapping between name and subid |
sub_result | | |
Parameter Name | Type (Format) | Description |
---|
sub_succ | array (sub_succ) | Successful subscription IDs and names |
sub_fail | array (string) | Names of failed subscriptions |
sub_succ | | |
Parameter Name | Type (Format) | Description |
---|
id | unit | Subscription ID |
name | string | Subscription name |
Request Example | | |
curl -X POST 'http://123.56.218.144:8043/ccapi/v2/subscriptions?Timestamp=1566446286&AppId=a54a8b77-f12d-4ac9-742d-5b2bef5c4d11&Sign=891462f08d113b0b1285e985ff7a7c56ba42a18f&Sid=123456789abcdef' -d '{\"subscriptions\": [{\"callback\": \"http://59.110.105.200:12345\",\"name\": \"sub1\",\"events\": [\"agent_ringing\", \"agent_answer\",\"start_dialout\", \"user_ringing\", \"user_answer\", \"agent_hangup\", \"user_hangup\"]},
{\"callback\": \"http://59.110.105.200:12345\",\"name\": \"sub2\",\"events\": [\"agent_ringing\", \"agent_answer\",\"start_dialout\", \"user_ringing\", \"user_answer\", \"agent_hangup\", \"user_hangup\"]},
{\"callback\": \"http://59.110.105.200:12345\",\"name\": \"sub3\",\"events\": [\"agent_ringing\", \"agent_answer\",\"start_dialout\", \"user_ringing\", \"user_answer\", \"agent_hangup\", \"user_hangup\"]},
{\"callback\": \"http://59.110.105.200:12345\",\"name\": \"sub4\",\"events\": [\"agent_ringing\", \"agent_answer\",\"start_dialout\", \"user_ringing\", \"user_answer\", \"agent_hangup\", \"user_hangup\"]}
]}'
Response Example
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": {
"sub_succ":[{"id":1,"name":"sub1"},{"id":2,"name":"sub2"}],
"sub_fail":["sub3","sub4"]
}
}
Batch Query for Message Subscriptions
URL: subscriptions
METHOD: GET
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
Response Result | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Result | array (subscription) | List of subscription events |
subscription | | |
Parameter Name | Required | Type (Format) | Description |
---|
callback | Y | string (url) | Callback URL |
name | Y | string | Name of the subscription |
events | Y | [string] | List of subscribed events |
enable | Y | bool | Subscription status: true - enabled, false - disabled |
Request Example | | | |
curl -X GET 'http://123.56.218.144:8043/ccapi/v2/subscriptions?Timestamp=1566446286&AppId=a54a8b77-f12d-4ac9-742d-5b2bef5c4d11&Sign=891462f08d113b0b1285e985ff7a7c56ba42a18f&Sid=123456789abcdef'
Response Example
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": [
{
"callback": "http://59.110.105.200:12345",
"name": "sub1",
"events": [
"agent_ringing",
"agent_answer",
"start_dialout"
],
"enable": false
},
{
"callback": "http://59.110.105.200:12345",
"name": "sub1",
"events": [
"agent_ringing",
"agent_answer",
"start_dialout"
],
"enable": false
}
]
}
Single Query for Message Subscription
URL: subscriptions/{id}
METHOD: GET
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
Response Result | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Result | subscription | Subscription object |
subscription | | |
Parameter Name | Required | Type (Format) | Description |
---|
callback | Y | string (url) | Callback URL |
name | Y | string | Name of the subscription |
events | Y | [string] | List of subscribed events |
enable | Y | bool | Subscription status: true - enabled, false - disabled |
Request Example | | | |
curl -X GET 'http://123.56.218.144:8043/ccapi/v2/subscriptions/8?Timestamp=1566446286&AppId=a54a8b77-f12d-4ac9-742d-5b2bef5c4d11&Sign=891462f08d113b0b1285e985ff7a7c56ba42a18f&Sid=123456789abcdef'
Response Example
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": {
"callback": "http://59.110.105.200:12345",
"name": "sub1",
"events": [
"agent_ringing",
"agent_answer",
"start_dialout"
],
"enable": false
}
}
Update Message Subscription
URL: subscriptions/{id}
METHOD: PUT
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
subscription | Y | object (subscription) | Subscription object |
subscription | | | |
Parameter Name | Type (Format) | Description |
---|
callback | Y | string (url) |
name | Y | string |
events | Y | array (string) |
enable | Y | bool |
Response Result | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Result | [object] | Mapping between name and subscription ID |
object | | |
Parameter Name | Type (Format) | Description |
---|
SubId | number | Unique subscription ID |
name | string | Name of the subscription |
Request Example | | |
curl -X PUT 'http://123.56.218.144:8043/ccapi/v2/subscriptions/7?Timestamp=1566446286&AppId=a54a8b77-f12d-4ac9-742d-5b2bef5c4d11&Sign=891462f08d113b0b1285e985ff7a7c56ba42a18f&Sid=123456789abcdef' -d '{\"callback\": \"http://59.110.105.911:12345\",\"name\": \"sub1\",
\"events\": [\"user_ringing\", \"user_answer\", \"agent_hangup\", \"user_hangup\"],\"state\":0}'
Response Example
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": {
"sub1": 7
}
}
Delete Message Subscription
URL: subscriptions/{id}
METHOD: DELETE
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
Response Result | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Request Example | | |
curl -X DELETE 'http://123.56.218.144:8043/ccapi/v2/subscriptions/8?Timestamp=1566446286&AppId=a54a8b77-f12d-4ac9-742d-5b2bef5c4d11&Sign=891462f08d113b0b1285e985ff7a7c56ba42a18f&Sid=123456789abcdef'
Response Example
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": ""
}
Callback Authentication
The authentication method for the callback URL is as follows:
callback Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | string | Timestamp, the number of seconds since the current time from UTC time, 1970-01-01 00:00:00 |
AppId | Y | string (uuid) | Application ID |
Sign | Y | string | Signature |
callback Signature Calculation Method | | | |
Secret is the encryption field returned when creating the application and needs to be saved by the user. | | | |
Sign: SHA1(AppId + Secret + Timestamp) | | | |
Client Interface Description
Agent Client Interface
NOTE: The client uses WebSockets, and all requests are asynchronous.
*Check-In
{
// #include <standard_header>
"Method": "login",
"AppId": "xxxxxxxxxxxxxxxx",
"AgentId": "xxxxxxxxxxxxxxxx",
"Token": "xxxxxxxxxxxxxxxx",
"State": "idle", // Initial state of the Agent, optional, defaults to idle
}
*Check-Out (Go Offline)
{
// #include <standard_header>
"Method": "logout",
}
*Set Busy
{
// #include <standard_header>
"Method": "setState",
"State": "busy",
}
*Set Idle
{
// #include <standard_header>
"Method": "setState",
"State": "idle",
}
*Away (Short Break)
{
// #include <standard_header>
"Method": "setState",
"State": "onBreak",
"SubState": 0, // SubState defaults to 0, can be an integer >= 0
}
*Hang Up
{
// #include <standard_header>
"Method": "hangup",
}
*Set Call Mode [WebRTC]
{
// #include <standard_header>
"Method": "setCallMode",
"Contact": "xxxx", // cellphone/voip
"UserData": "xxxx", // User data to be carried along
}
*Outbound Call
{
// #include <standard_header>
"Method": "dialout",
"DestNumber": "xxxx", // Destination number
"SpNumber": "xxxx", // Calling number displayed
"UserData": "xxxx", // User data to be carried along
}
Success Response
{
"Method": "dialout",
"DestNumberLoc": "", // Location of the called number
"UserData": ""
}
*Get Current State
NOTE: The call state returns detailed information about the call.
{
// #include <standard_header>
"Method": "getState",
}
Response
{
// #include <standard_header>
"Method": "getState",
"CurState": "idle",
"StartTime": xxxxx, // timestamp - the time when the agent's state changed
"CurMode": "", // cellphone | voip
"CurExtState": "", // current extension state
// If in a call state, the following information will be included:
"DestNumber": "",
"DestNumberLoc": "", // number location
"SpNumber": "",
"CallDirection": "",
"UserData": "",
}
Agent Client Events
*Outbound Agent Phone Ringing
{
// #include <standard_header>
"Method": "agentRinging",
"AgentNumber": "",
"DestNumber": "",
"DestNumberLoc": "", // Number location
"SpNumber": "",
"CallDirection": "",
"UserData": "",
}
*Outbound Agent Off-Hook
{
// #include <standard_header>
"Method": "agentAnswered",
"AgentNumber": "",
"DestNumber": "",
"DestNumberLoc": "", // Number location
"SpNumber": "",
"CallDirection": "",
"UserData": "",
}
*Outbound User Ringing
{
// #include <standard_header>
"Method": "userRinging",
"AgentNumber": "",
"DestNumber": "",
"DestNumberLoc": "", // Number location
"SpNumber": "",
"CallDirection": "",
"UserData": "",
}
*Outbound User Off-Hook
{
// #include <standard_header>
"Method": "userAnswered",
"AgentNumber": "",
"DestNumber": "",
"DestNumberLoc": "", // Number location
"SpNumber": "",
"CallDirection": "",
"UserData": "",
}
*Agent Hang Up
{
// #include <standard_header>
"Method": "agnetHangup",
"Reason": "",
}
*User Hang Up
{
// #include <standard_header>
"Method": "userHangup",
"Reason": "",
}
*Agent State Change
{
// #include <standard_header>
"Method": "agentStateChange",
"CurState": "",
"CurStateSubId": 0, // This item exists for break states
"OldState": "",
}
*Agent Call Mode Change
{
// #include <standard_header>
"Method": "agentCallModeChange",
"CurContact": "",
}
*Extension State Change
{
// #include <standard_header>
"Method": "extensionStateChange",
"CurState": "",
"OldState": "",
"Reason": "",
}
*Server Disconnect
{
// #include <standard_header>
"Method": "disconnect",
"Reason": "",
}
Data Acquisition
Obtaining Call Logs
URL: calls/logs
METHOD: GET
NOTE:
- Only fetch completed calls.
- Retrieve calls by CallId if specified, with priority given to CallId.
- Calls within a certain time range can be retrieved, up to 1 week ago. Data older than 1 week cannot be retrieved.
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
CallId | N | string (uuid) | Call ID, if provided, only retrieve records for this CallId |
PageSize | N | number | Page size, maximum 100 |
PageNum | N | number | Page number |
StartTime | N | timestamp | Start time of the call |
EndTime | N | timestamp | End time of the call |
Note: Parameters such as CallId should be passed through a JSON-formatted request body. If not passed, an empty {} request body should be submitted, otherwise an error "100004 unexpected end of JSON input" will occur. | | | |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Result | object | As follows |
Result | | |
Parameter Name | Type (Format) | Description |
---|
CallLogs | [CallLog] | List of call logs, as follows |
CallLog | | |
Parameter Name | Type (Format) | Description |
---|
CallId | string (uuid) | Call identifier |
StartTime | timestamp | Start time of the call |
EndTime | timestamp | End time of the call |
AgentAnswerTime | timestamp | Agent answer time |
UserAnswerTime | timestamp | User answer time |
CallDuration | number | Call duration, in seconds |
TotalDuration | number | Total call duration, in seconds |
DestNumber | string (digits) | User number |
UNProvince | string | User number province |
UNCity | string | User number city |
SpNumber | string (digits) | Relay number |
AgentId | string (digits) | Agent ID |
AgentName | string | Agent name |
WorkId | string | Agent extension |
Email | string (email) | Agent email |
CallType | string | Call type, such as: incoming, outgoing, incoming (transfer), incoming (monitor), etc. |
EndType | string | Call outcome |
HangupBy | string | Party that hung up, customer or agent |
HangupReason | string | Reason for hangup |
HangupCode | string (digits) | Hangup return code |
AgentDevType | string | Device type, either "IP phone" or "mobile, soft phone" |
RobotVars | map[string]object | AI variables |
AIRecordLen | number | AI recording duration |
AdCallId | string | Automatic dialing call ID |
AdTaskId | string | Automatic dialing task ID |
Request Example | | |
$ curl -X GET 'http://ip:port/ccapi/v2/calls/logs?Timestamp=1566530056&AppId=d30fe35c-995d-4921-55b8-ad21b476bbb8&Sign=e3d716dfd01e67207bb998f2b0c7dc7cdf2bf2b4&Sid=123456789abcdef' -d '{"CallId":"bc1cc555-0b24-4e1c-9979-a514888ea495","PageSize":20,"PageNum":1,"StartTime":1566316800000,"EndTime":1566489599000}'
Response Example
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": {
"CallLogs": [
{
"CallId": "bc1cc555-0b24-4e1c-9979-a514888ea495",
"StartTime": 1566298669326,
"EndTime": 1566320334606,
"AgentAnswerTime": 1566298674686,
"UserAnswerTime": 0,
"CallDuration": 0,
"TotalDuration": 21665,
"DestNumber": "01086482889",
"UNProvince": "",
"UNCity": "",
"SpNumber": "057128091649",
"AgentId": "",
"AgentName": "",
"WorkId": "",
"Email": "",
"CallType": "Outgoing",
"EndType": "callResult",
"HangupBy": "agent",
"HangupReason": "",
"HangupCode": "",
"AgentDevType": "voip",
"RobotVars": null,
"AIRecordLen": 0,
"AdCallId": "",
"AdTaskId": ""
},
{
"CallId": "50def7e0-cf70-411e-9e05-4381817b441c",
"StartTime": 1566351290766,
"EndTime": 1566351302186,
"AgentAnswerTime": 1566351292686,
"UserAnswerTime": 0,
"CallDuration": 0,
"TotalDuration": 12,
"DestNumber": "057128091649",
"UNProvince": "",
"UNCity": "",
"SpNumber": "057128091649",
"AgentId": "",
"AgentName": "",
"WorkId": "",
"Email": "",
"CallType": "Incoming",
"EndType": "callResult",
"HangupBy": "agent",
"HangupReason": "",
"HangupCode": "",
"AgentDevType": "voip",
"RobotVars": null,
"AIRecordLen": 0,
"AdCallId": "",
"AdTaskId": ""
}
]
}
}
Obtaining Recording Records
URL: calls/recfiles
METHOD: GET
NOTE:
- Retrieve call recordings by CallId if specified, with priority given to CallId.
- Call recording lists within a certain time range can be retrieved, up to 1 week ago. Data older than 1 week cannot be retrieved.
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
CallId | N | string (uuid) | Call ID, if provided, only retrieve records for this CallId |
PageSize | N | number | Page size, maximum 100 |
PageNum | N | number | Page number |
StartTime | N | timestamp | Start time of the call |
EndTime | N | timestamp | End time of the call |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Result | object | As follows |
Result | | |
Parameter Name | Type (Format) | Description |
---|
RecFiles | [RecFile] | List of recording records, as follows |
RecFile | | |
Parameter Name | Type (Format) | Description |
---|
CallId | string (uuid) | Call identifier |
StartTime | timestamp | Recording start time |
EndTime | timestamp | Recording end time |
Duration | number | Recording duration, in seconds |
RecFileUrl | string (url) | Recording file URL |
Obtaining Agent Status Change Logs
Filtering conditions: AgentId, or time, AppId
URL: agents/statelogs
METHOD: GET
NOTE:
- If AgentId is specified, only the status change logs for that agent are returned.
- If AgentId is not specified, the status change logs for all agents in the enterprise are returned.
- Time period limit: 1 week
Request Parameters
Parameter Name | Required | Type (Format) | Description |
---|
Timestamp | Y | number (Timestamp) | Timestamp |
AppId | Y | string (uuid) | Application ID |
AgentId | N | string (uuid) | Agent ID |
PageSize | N | number | Page size, maximum 100 |
PageNum | N | number | Page number |
StartTime | N | timestamp | Start time |
EndTime | N | timestamp | End time |
Response Results | | | |
Parameter Name | Type (Format) | Description |
---|
ErrCode | string (digits) | Response code |
ErrDesc | string | Response description |
Result | object | As follows |
Result | | |
Parameter Name | Type (Format) | Description |
---|
AgentStateLogs | [AgentStateLog] | List of agent state logs, as follows |
AgentStateLog | | |
Parameter Name | Type (Format) | Description |
---|
AgentId | string (digits) | Agent ID |
AgentName | string | Agent name |
WorkId | string | Agent extension |
CurState | string | Current state |
CurStateSubId | number | Current state sub-ID |
StartTime | timestamp | Start time of the current state |
EndTime | timestamp | End time of the current state |
Duration | number | Duration of the current state, in seconds |
OldState | string | Previous state |
OldStateSubId | number | Previous state sub-ID |
Code Error Codes
Error Code | Message Information | Description |
---|
000001 | AgentId AppId WorkId Blank | Missing parameters AgentId, AppId, and WorkId in the request |
| Parameter error | Incorrect request parameters |
| ParamsInvalid | Invalid input parameters |
| File name Blank | The provided IVR filename is empty |
000003 | System internal error | System internal error |
000004 | Data does not exist | The data to be deleted does not exist |
100002 | AppId AppNotFound or forbidden | Missing AppId in the parameters or the AppId is disabled |
100004 | Duplicate entry xxx for yyy | The agentId or queueId is duplicate with existing ones |
| Unexpected end of JSON input | Request body is missing or the format is incorrect |
| Agent has queue or voip, can't delete | The agent is bound to a queue or IP phone and cannot be deleted |
100015 | NumberIsExisted | The extension number already exists |
100016 | VoipBindAgent | The extension bound to an agent cannot be deleted |
100017 | AppID Blank | Missing AppId in the parameters |
100018 | RecordNotFound | The resource corresponding to the agentId in the request body could not be found, possibly an agent, queue, IVR voice record, etc. |
| Queue Blank | The queue corresponding to the provided queueId could not be found |