Official API Documentation
Public Information
General Specifications
Request Format
Base URL
https://{host}/{Type}/{version}/{api}?Timestamp={Timestamp}&AppId={AppId}
- host: API domain name
- Type:
ccapi
- version: API version, currently
v2
- api: See API URI
- Timestamp: UTC timestamp, accurate to the millisecond
- AppId: Used to specify which APP to operate on, UUID string, should be included except for creating an APP 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 after the change).
- 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 the operation is idempotent (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 creation or modification operations, and the 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 the 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.
Return Format
General
- Returns in UTF-8 encoded JSON format
- Response codes see Response Codes Correct Return Format
{
"ErrCode": "000000", // Response code (required)
"ErrDesc": "OK", // Response description (required)
"Result": {
// Data...
}
}
Error Return Format
{
"ErrCode": "000001", // Response code (required)
"ErrDesc": "Parameter error", // Response description (required)
"Result": {
// Data...
}
}
Data Format Conventions
PSTN Numbers
- Landline format:
0{area code}{local number}
- Mobile format:
{11-digit mobile number}
- International number:
00{international area code}{domestic area code}{local number}
- Agent SIP number:
{corporate number prefix}{agent extension number}
- Corporate number prefix:
9{9-digit number}
- Agent extension number:
{4-digit number}
Example
"01067654637" # Landline number
"13676546374" # Mobile number
Extension Numbers (Extension)
- Four-digit number starting with a non-zero digit:
[1-9]\\d{3}
Example
"8001" # Extension number
QueueId
- A 4-digit number starting with 9:
9\d{3}
AgentId - Digits:
\d+
- Maximum length: 32 characters WorkId
- Digits or characters:
\w+
- Maximum length: 32 characters Timestamp
- Uses UTC time
- Format: Unix Time, which is the number of milliseconds since "1970-01-01 00:00:00.000".
Authentication Method
Server-side Interface Authentication
- All interfaces use HTTPS encryption
- Sign:
SHA1(Sid + AuthToken + Timestamp)
- Sid: Account
- AuthToken: Authentication token
- Timestamp: Time stamp, valid within 10 minutes
- Parameters (URL Query String)
- Timestamp
- Sid
- Sign Example
https://xxx.udesk.cn/ccapi/v2/agents?AppId={{appid}}&Timestamp={{mytime}}&Sign={{Sign}}&Sid={{Sid}}
Return Code Description
Return Code | Description |
---|---|
000000 | Success |
000001 | Invalid parameter |
000035 | Request timeout |
000036 | Incorrect request |
000060 | Internal error |
100001 | Parameter is empty |
100002 | App is invalid or forbidden |
100003 | Account not found |
100004 | Incorrect message |
100005 | Relay number not found |
100006 | Name already exists |
100007 | Voice not found |
100008 | Invalid wav file |
100009 | Wav file conversion failed |
100010 | Failed to create default voice file |
100011 | Failed to create new bucket |
100012 | Failed to download file |
100013 | Database initialization failed |
100014 | Md5 check failed |
100015 | Number exists |
100016 | Voice binding agent |
100017 | App ID is empty |
100018 | No records found |
100019 | Parsing failed |
100020 | Ivr not found |
100021 | Invalid agent status |
100022 | Ownership error |
200001 | This app does not exist |
200002 | Parameter error |
200003 | Service resolution error |
200004 | No related records found |
200005 | Start node error |
200006 | Condition node error |
200007 | Play node error |
200008 | Voice collection node error |
200009 | Queue node error |
200010 | Webhook node error |
200011 | Number collection node error |
200018 | Hangup node error |
200019 | This name already exists |
200020 | Authentication error |
200021 | Internal service error |
200022 | Routing format error |
200023 | Database error |
200024 | Missing start or end node |
Open API
01. Get Relay Number List
Basic Information
Path: /ccapi/v2/spnumbers Method: GET Interface Description:
Overview
Returns a list of all relay numbers bound within the application, as well as the application's default caller ID number.
Glossary
Relay Number: A general term for numbers bound to application numbers (usually divided into digital relay numbers and analog fixed phone numbers, the main difference being that the former supports multi-concurrent calls), which may be provided by Udesk or built by users themselves.
Caller ID: When you make a call from your personal phone to someone else's phone, the caller ID number displayed on the recipient's phone (if they have caller ID display service), this is the caller ID; similarly, when making outgoing calls using the Udesk CCPaaS platform, a caller ID is also needed, and the number will be selected in the following order:
- Preferably use the relay number specified for outgoing calls;
- Use the default caller ID of the agent;
- Use the default caller ID of the application;
- If none of the above are met, the system selects a number randomly.
Example
Request
URL: http://ip:port/ccapi/v2/spnumbers?AppId={{appid}}&Timestamp={{mytime}}&Sign={{Sign}}&Sid={{Sid}}
Response
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": {
"SpNumbers": [
"057126200671",
"057126200672",
"057126200673",
"057126200674"
],
"DefSpNumber": "057126200670"
}
}
Request Parameters
Query
Parameter Name | Required | Example | Notes |
---|---|---|---|
AppId | Yes | 3c31d817-4d37-46d8-6c09-1be54dda3c03 | Application ID |
Return Data
Name | Type | Required | Default | Notes | Other Information |
---|---|---|---|---|---|
ErrCode | string | Not Required | Response Code | mock: 000000 | |
ErrDesc | string | Not Required | Response Description | mock: OK | |
Result | object | Not Required | Response Result | ||
├─ SpNumbers | string [] | Not Required | Relay Number List | item Type: string | |
├─ | Not Required | ||||
├─ DefSpNumber | string | Not Required | Current Default Relay Number | mock: 057126200670 |
02. Modify Default Relay Number
Basic Information
Path: /ccapi/v2/spnumbers/default Method: PUT Interface Description:
Overview
Edit the default caller ID number for the application.
Example
Request
URL: http://ip:port/ccapi/v2/spnumbers/default?AppId={{appid}}&Timestamp={{mytime}}&Sign={{Sign}}&Sid={{Sid}}
BODY:
{
"DefSpNumber":"057126200670"
}
Response
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": null
}
Request Parameters
Headers
Parameter Name | Parameter Value | Required | Example | Notes |
---|---|---|---|---|
Content-Type | application/json | Yes |
Query
Parameter Name | Required | Example | Notes |
---|---|---|---|
AppId | Yes | 4b8dc715-05e0-4340-6cae-a6e3c39a6012 | Application ID |
Body
Name | Type | Required | Default | Notes | Other Information |
---|---|---|---|---|---|
DefSpNumber | string | Not Required | The default relay number is the first one in the list, but it can be any number from the relay number list | mock: 057126200670 |
Return Data
Name | Type | Required | Default | Notes | Other Information |
---|---|---|---|---|---|
ErrCode | string | Not Required | Response Code | mock: 000000 | |
ErrDesc | string | Not Required | Response Description | mock: OK | |
Result | string | Not Required | Response Result |
03. Delete Default Relay Number
Basic Information
Path: /ccapi/v2/spnumbers/default Method: DELETE Interface Description:
Overview
Clear the default caller ID number for the application.
Example
Request
URL: http://ip:port/ccapi/v2/spnumbers/default?AppId={{appid}}&Timestamp={{mytime}}&Sign={{Sign}}&Sid={{Sid}}
Response
{
"ErrCode":"000000",
"ErrDesc":"OK",
"Result":""
}
Request Parameters
Headers
Parameter Name | Parameter Value | Required | Example | Notes |
---|---|---|---|---|
Content-Type | application/json | Yes |
Query
Parameter Name | Required | Example | Notes |
---|---|---|---|
AppId | Yes | 4b8dc715-05e0-4340-6cae-a6e3c39a6012 | Application ID |
Body
Name | Type | Required | Default | Notes | Other Information |
---|
Return Data
Name | Type | Required | Default | Notes | Other Information |
---|---|---|---|---|---|
ErrCode | string | Not Required | Response Code | mock: 000000 | |
ErrDesc | string | Not Required | Response Description | mock: OK | |
Result | string | Not Required | Response Result | mock: |
04. Create Agent
Basic Information
Path: /ccapi/v2/agents Method: POST Interface Description:
Overview
Create an agent.
The basic object relationship in Udesk CC-PaaS is shown in the following diagram:
- An application can create multiple agents, queues, and extensions;
- An agent must be in at least one queue;
- An agent can only be bound to one extension of the same type (SIP or WebRTC);
- An agent can only make or receive calls after binding an extension;
- If the application has enabled web phone functionality (WebRTC), and the 'IsCreateExtension' parameter is set to 'true', then when creating an agent, both types of extensions (WebRTC and SIP) will be created simultaneously and bound to that agent.
Example
Request
URL: http://ip:port/ccapi/v2/agents?AppId={{appid}}&Timestamp={{mytime}}&Sign={{Sign}}&Sid={{Sid}}
BODY:
{
"AgentId": "9415",
"WorkId": "199"
}
Response
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": {
"AgentId": "9415",
"Extension": "",
"Password": "",
"Number": "",
"ExtenInfos": null
}
}
Request Parameters
Headers
Parameter Name | Parameter Value | Required | Example | Notes |
---|---|---|---|---|
Content-Type | application/json | Yes |
Query
Parameter Name | Required | Example | Notes |
---|---|---|---|
AppId | Yes | 4b8dc715-05e0-4340-6cae-a6e3c39a6012 | Application ID |
Body
Name | Type | Required | Default | Notes | Other Information |
---|---|---|---|---|---|
AgentId | string | Required | Agent ID | mock: 197 | |
WorkId | string | Required | Agent Work ID | mock: 191 | |
Name | string | Optional | Agent Name | mock: Li | |
Mobile | string | Optional | Agent Mobile | mock: 18512520714 | |
string | Optional | Agent Email | mock: 123@qq.com | ||
Role | string | Optional | Agent Role, can be agent, leader, default is agent | mock: agent | |
Enable | boolean | Optional | true: Enable, default is enabled | mock: false | |
IsCreateExtension | integer | Optional | Create and bind extension for the agent | ||
WrapUpTime | integer | Optional | Incoming call wrap-up time | ||
OutWrapUpTime | integer | Optional | Outgoing call wrap-up time | ||
AssistantAccessRight | integer | Optional | Assistant access rights |
Response Data
Name | Type | Required | Default | Notes | Other Information |
---|---|---|---|---|---|
ErrCode | string | Optional | Response Code | mock: 000000 | |
ErrDesc | string | Optional | Response Description | mock: OK | |
Result | object | Optional | If extension is bound simultaneously | ||
├─ Extension | string | Optional | Extension Number | mock: 1002 | |
├─ Password | string | Optional | Extension Password | mock: 1002 | |
├─ AgentId | string | Optional | Agent ID | mock: 197 | |
├─ Number | string | Optional | Trunk Number | mock: 057126200670 | |
├─ ExtenInfos | string[] | Optional | Extension Number List | item Type: string | |
├─ | Optional |
05. Modify Agent
Basic Information
Path: /ccapi/v2/agents/{id}
Method: PUT
Interface Description:
Overview
Modify agent information
Disable agent: The agent can only be disabled when it is offline.
Note: AgentId cannot be modified.
Example
Request
URL: http://ip:port/ccapi/v2/agents/{id:[0-9]+}?AppId={{appid}}&Timestamp={{mytime}}&Sign={{Sign}}&Sid={{Sid}}
BODY:
{
"AgentId":"9415",
"Enable":false
}
Response
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": null
}
Request Parameters
Headers
Parameter Name | Parameter Value | Required | Example | Notes |
---|---|---|---|---|
Content-Type | application/json | Yes |
Path Parameters
Parameter Name | Example | Notes |
---|---|---|
id | {id:[0-9]+} |
Query
Parameter Name | Required | Example | Notes |
---|---|---|---|
AppId | Yes | a54a8b77-f12d-4ac9-742d-5b2bef5c4d11 |
Body
Name | Type | Required | Default | Notes | Other Information |
---|---|---|---|---|---|
AgentId | string | Optional | Seat ID | mock: 724 | |
WorkId | string | Optional | Task ID | mock: 11 | |
Name | string | Optional | Seat Name | ||
Mobile | string | Optional | Seat Mobile | mock: 17600364320 | |
string | Optional | Seat Email | |||
Role | string | Optional | Remarks | ||
Enable | boolean | Optional | Whether to enable | mock: false | |
WrapUpTime | integer | Optional | Incoming wrap-up time | ||
OutWrapUpTime | integer | Optional | Outgoing wrap-up time | ||
AssistantAccessRight | integer | Optional | Assistant usage rights |
Response Data
Name | Type | Required | Default | Notes | Other Information |
---|---|---|---|---|---|
ErrCode | string | Optional | Response Code | mock: 000000 | |
ErrDesc | string | Optional | Response Description | mock: ok | |
Result | string | Optional | Response Result |
06. Get Seat List
Basic Information
Path: /ccapi/v2/agents
Method: GET
Interface Description:
Overview
Obtain seat information, which can be queried according to relevant conditions. If no conditions are specified, the entire seat list will be returned.
Fixed query conditions include: role, availability status, seat status;
Fuzzy query text matching range: seat name, seat number, email, mobile phone number.
Example
Request
URL: http://ip:port/ccapi/v2/agents?AppId={{appid}}&Timestamp={{mytime}}&Sign={{Sign}}&Sid={{Sid}}
URL(Predefined Query Conditions): http://ip:port/ccapi/v2/agents?Role={{Role}}&Enable={{Enable}}&State={{State}}&FuzzyQuery={{FuzzyQuery}}AppId={{appid}}&Timestamp={{mytime}}&Sign={{Sign}}&Sid={{Sid}}
Response
{
"ErrCode": "000000",
"ErrDesc": "",
"Result": {
"CurrPage": 1,
"PageSize": 32,
"Total": 32,
"TotalPage": 1,
"AgentList": [
{
"AppId": "4b8dc715-05e0-4340-6cae-a6e3c39a6012",
"AgentId": "189",
"WorkId": "",
"Name": "Admin 1",
"Mobile": "17600364320",
"Email": "crmdiaoxiao1@test.cn",
"Role": "agent",
"Queues": [
"9003@4b8dc715-05e0-4340-6cae-a6e3c39a6012"
],
"QueuesNames": null,
"Extensions": [
"1001",
"1008"
],
"DefSpNumber": "02863138587",
"State": 1,
"ExtState": 0,
"WrapUpTime": 0,
"OutWrapUpTime": 0,
"Enable": true,
"ExtenInfos": null
}
]
}
}
Request Parameters
Query
Parameter Name | Required | Example | Remarks |
---|---|---|---|
AppId | Yes | 4b8dc715-05e0-4340-6cae-a6e3c39a6012 | Tenant ID |
Response Data
Name | Type | Required | Default | Remarks | Other Information |
---|---|---|---|---|---|
ErrCode | string | Not Required | Response Code | mock: 000000 | |
ErrDesc | string | Not Required | Response Description | mock: OK | |
Result | object | Not Required | Response Result | ||
├─ CurrPage | number | Not Required | Current Page | mock: 1 | |
├─ PageSize | number | Not Required | Items per Page | mock: 10 | |
├─ Total | number | Not Required | Total Items | mock: 100 | |
├─ TotalPage | number | Not Required | Total Pages | mock: 10 | |
├─ AgentList | object[] | Not Required | Agent List | item type: object | |
├─ AppId | string | Not Required | Application ID | mock: 4b8dc715-05e0-4340-6cae-a6e3c39a6012 | |
├─ AgentId | string | Not Required | Agent ID | mock: 112 | |
├─ WorkId | string | Not Required | Work ID | mock: 111 | |
├─ Name | string | Not Required | Agent Name | mock: test | |
├─ Mobile | string | Not Required | Agent Mobile Number | mock: 17600364320 | |
string | Not Required | Agent Email | mock: test@qq.com | ||
├─ Role | string | Not Required | Remarks | mock: "" | |
├─ Queues | string[] | Not Required | Agent Queue List | item type: string | |
├─ QueuesNames | string[] | Not Required | Queue Name List | item type: string | |
├─ Extensions | string[] | Not Required | Extension Number List | item type: string | |
├─ DefSpNumber | string | Not Required | Default Trunk Number | mock: c39a6012 | |
├─ State | number | Not Required | Status | mock: 1 | |
├─ ExtState | string | Not Required | Default Extension Status | mock: 0 | |
├─ WrapUpTime | string | Not Required | Incoming Call Wrap-Up Time | mock: 0 | |
├─ OutWrapUpTime | string | Not Required | Outgoing Call Wrap-Up Time | mock: 0 | |
├─ Enable | string | Not Required | Is Enabled | mock: false | |
├─ ExtenInfos | object[] | Optional | Extension Number Information | item type: object | |
├─ Number | string | Optional | Trunk Number | mock: 94286518751002 | |
├─ Extension | string | Optional | Extension Number | mock: 1002 | |
├─ Password | string | Optional | Extension Password | mock: eewz | |
├─ SignalType | string | Optional | Signal Type | mock: 1 |
07. Seat Extension Binding
Basic Information
Path: /ccapi/v2/agents/extensions
Method: POST
Interface Description:
Overview
Binds extensions to the specified agent, allowing the binding of two types of extensions simultaneously.
Note:
The agent needs to manually switch to the extension type that matches the current outgoing call method. For example, if using web phone for outgoing calls, switch to the webrtc type extension.
Example
Request
URL: http://ip:port/ccapi/v2/agents/extensions?AppId={{appid}}&Timestamp={{mytime}}&Sign={{Sign}}&Sid={{Sid}}
BODY:
{
"AgentId":"9415",
"Extensions":["1135"]
}
Response
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": null
}
Request Parameters
Headers
Parameter Name | Parameter Value | Required | Example | Remarks |
---|---|---|---|---|
Content-Type | application/json | Yes |
Query
Parameter Name | Required | Example | Remarks |
---|---|---|---|
AppId | Yes | 4b8dc715-05e0-4340-6cae-a6e3c39a6012 | Application ID |
Body
Name | Type | Required | Default Value | Remarks | Other Information |
---|---|---|---|---|---|
AgentId | string | Required | Agent ID | mock: 10031 | |
WorkId | string | Not Required | Task ID | ||
Name | string | Not Required | Agent Name | ||
Mobile | string | Not Required | Agent Mobile Number | ||
string | Not Required | Agent Email | |||
Role | string | Not Required | Remarks | ||
Queues | string[] | Not Required | Queues | item type: string | |
├─ | Not Required | ||||
QueuesNames | string[] | Not Required | Queue Names | item type: string | |
├─ | Not Required | ||||
Extensions | string[] | Required | List of Extension Numbers | item type: string | |
├─ | Not Required | ||||
State | integer | Not Required | Agent State Type | ||
ExtState | integer | Not Required | Bound Extension State | ||
WrapUpTime | integer | Not Required | Inbound Wrap-Up Time | ||
OutWrapUpTime | integer | Not Required | Outbound Wrap-Up Time | ||
Enable | boolean | Not Required | Whether to Enable | ||
AssistantAccessRight | integer | Not Required | Assistant Access Rights |
Return Data
Name | Type | Required | Default Value | Remarks | Other Information |
---|---|---|---|---|---|
ErrCode | string | Not Required | Response Code | mock: 000000 | |
ErrDesc | string | Not Required | Response Description | mock: OK | |
Result | string | Not Required | Response Result | mock: |
08. Unbinding Extensions for Agents
Basic Information
Path: /ccapi/v2/agents/extensions
Method: DELETE
Interface Description:
Overview
This interface is used to unbind extensions for a specified agent, allowing the simultaneous unbinding of two types of extensions.
Note:
If you intend to delete an agent, you must first unbind all extensions associated with that agent and remove the agent from all regular queues.
Example
Request
URL: http://ip:port/ccapi/v2/agents/extensions?AppId={{appid}}&Timestamp={{mytime}}&Sign={{Sign}}&Sid={{Sid}}
BODY:
{
"AgentId":"9415",
"Extensions":["1135"]
}
Response
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": null
}
Request Parameters
Headers
Parameter Name | Parameter Value | Required | Example | Notes |
---|---|---|---|---|
Content-Type | application/json | Yes |
Query
Parameter Name | Required | Example | Notes |
---|---|---|---|
AppId | Yes | 4b8dc715-05e0-4340-6cae-a6e3c39a6012 | Application ID |
Body
Name | Type | Required | Default Value | Notes | Other Information |
---|---|---|---|---|---|
Extensions | string[] | Required | List of extension numbers | item type: string | |
├─ | Not Required | ||||
AgentId | string | Required | Agent ID | mock: 62 |
Return Data
Name | Type | Required | Default Value | Notes | Other Information |
---|---|---|---|---|---|
ErrCode | string | Not Required | Response Code | mock: 000000 | |
ErrDesc | string | Not Required | Response Description | mock: OK | |
Result | string | Not Required | Response Result | mock: |
09. Delete Extension
Basic Information
Path: /ccapi/v2/extensions
Method: DELETE
Interface Description:
Overview
Delete an extension.
Note:
An extension bound to an agent cannot be deleted; it must be unbound first.
Example
Request
URL: http://ip:port/ccapi/v2/extensions?AppId={{appid}}&Timestamp={{mytime}}&Sign={{Sign}}&Sid={{Sid}}
BODY:
{
"Extension":"1002"
}
Response
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": null
}
Request Parameters
Headers
Parameter Name | Parameter Value | Required | Example | Notes |
---|---|---|---|---|
Content-Type | application/json | Yes |
Query
Parameter Name | Required | Example | Notes |
---|---|---|---|
AppId | Yes | 4b8dc715-05e0-4340-6cae-a6e3c39a6012 | Application ID |
Body
Name | Type | Required | Default | Notes | Other Information |
---|---|---|---|---|---|
Extension | string | Required | Extension number | mock: 1002 | |
Password | string | Not Required | Extension password | ||
Number | string | Not Required | SIP account used by the agent | ||
SignalType | integer | Not Required | Extension type | mock: 0:sip,1:webrtc |
Return Data
Name | Type | Required | Default | Notes | Other Information |
---|---|---|---|---|---|
ErrCode | string | Not Required | Response code | mock: 000000 | |
ErrDesc | string | Not Required | Response description | mock: OK | |
Result | string | Not Required | Response result | mock: |
10. Create Extension
Basic Information
Path: /ccapi/v2/extensions
Method: POST
Interface Description:
Overview
Create an extension.
There are two types of extensions: 0 (SIP, corresponding to the SIP phone method), 1 (WebRTC, corresponding to the web phone method);
Note:
- The extension password is generated by the system and cannot be specified at creation;
- Extension Number: A string of four characters (0~9, and the first character must be 1);
- A ten-digit fixed prefix plus the extension number makes up the extension account, totaling 14 digits.
Example
Request
URL: http://ip:port/ccapi/v2/extensions?AppId={{appid}}&Timestamp={{mytime}}&Sign={{Sign}}&Sid={{Sid}}
BODY:
{
"Extension":"1002",
"Password":"802411d4",
"SignalType":0
}
Response
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": {
"Extension": "1002",
"Password": "336cd1655a1d0502",
"Number": "93000077121002",
"SignalType": 0
}
}
Request Parameters
Headers
Parameter Name | Parameter Value | Required | Example | Remarks |
---|---|---|---|---|
Content-Type | application/json | Yes |
Query
Parameter Name | Required | Example | Remarks |
---|---|---|---|
AppId | Yes | 4b8dc715-05e0-4340-6cae-a6e3c39a6012 | Application ID |
Body
Name | Type | Required | Default Value | Remarks | Other Information |
---|---|---|---|---|---|
Extension | string | Required | 4-digit extension number | mock: 1032 | |
Password | string | Not Required | Extension password | mock: 802411d4 | |
SignalType | integer | Not Required | Extension type: 0 (SIP), 1 (WebRTC) | mock: 0 |
Return Data
Name | Type | Required | Default Value | Remarks | Other Information |
---|---|---|---|---|---|
ErrCode | string | Not Required | Response code | mock: 000000 | |
ErrDesc | string | Not Required | Response description | mock: OK | |
Result | object | Not Required | Response result | ||
├─ Extension | string | Not Required | Extension number | mock: 1002 | |
├─ Password | string | Not Required | Extension password | mock: 802411d4 | |
├─ Number | string | Not Required | Extension account | mock: "93000077121002" | |
├─ SignalType | integer | Not Required | Extension type | mock: 0 (SIP, corresponding to the SIP phone method), 1 (WebRTC, corresponding to the web phone method) |
11. Get Queue List
Basic Information
Path: /ccapi/v2/queues
Method: GET
Interface Description:
Overview
Obtain a list of queue information.
Example
Request
URL: http://ip:port/ccapi/v2/queues?AppId={{appid}}&Timestamp={{mytime}}&Sign={{Sign}}&Sid={{Sid}}
Response
{
"ErrCode":"000000",
"ErrDesc":"OK",
"Result":{
"Queues":[
{
"QueueId":"9001",
"Name":"Admin test ",
"Strategy":0,
"Timeout":0,
"WaitMusic":"waitmusic.wav"
}
]
}
}
Request Parameters
Query
Parameter Name | Required | Example | Notes |
---|---|---|---|
AppId | Yes | ef05710f-1144-4e2a-721c-991bf9df440a | Application ID |
Response Data
Name | Type | Required | Default | Notes | Other Information |
---|---|---|---|---|---|
ErrCode | string | Not Required | Response Code | mock: 000000 | |
ErrDesc | string | Not Required | Response Description | mock: OK | |
Result | object | Not Required | Response Result | ||
├─ Queues | object[] | Not Required | Queue List | item type: object | |
├─ QueueId | string | Not Required | Queue ID | mock: 9001 | |
├─ Name | string | Not Required | Queue Name | mock: Admin test | |
├─ Strategy | number | Not Required | Queue Distribution Strategy | mock: 0 | |
├─ Timeout | number | Not Required | Queuing Wait Timeout | mock: 0 | |
├─ WaitMusic | string | Not Required | Music Played During Queuing Wait | mock: waitmusic.wav |
12. Creating a Queue
Basic Information
Path: /ccapi/v2/queues
Method: POST
Interface Description:
Overview
Create a queue
Example
Request
URL: http://ip:port/ccapi/v2/queues?AppId={{appid}}&Timestamp={{mytime}}&Sign={{Sign}}&Sid={{Sid}}
BODY:
{
"QueueId":"9008",
"QueueName":"Test Create Queue 007",
"WaitMusic":""
}
Response
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": {
"QueueId": "181154"
}
}
Request Parameters
Headers
Parameter Name | Parameter Value | Required | Example | Remarks |
---|---|---|---|---|
Content-Type | application/json | Yes |
Query
Parameter Name | Required | Example | Remarks |
---|---|---|---|
AppId | Yes | 4b8dc715-05e0-4340-6cae-a6e3c39a6012 | Application ID |
Body
Name | Type | Required | Default Value | Remarks | Other Information |
---|---|---|---|---|---|
QueueId | string | Not Required | Queue ID | mock: 9008 | |
QueueName | string | Not Required | Queue Name | mock: Test Create Queue 007 | |
WaitMusic | string | Not Required | Music to play while waiting in queue | mock: |
Return Data
Name | Type | Required | Default Value | Remarks | Other Information |
---|---|---|---|---|---|
ErrCode | string | Not Required | Response Code | mock: 000000 | |
ErrDesc | string | Not Required | Response Description | mock: OK | |
Result | string | Not Required | Response Result | mock: |
13. Modify Queue
Basic Information
Path: /ccapi/v2/queues
Method: PUT
Interface Description:
Overview
Modify the specified queue.
'Strategy' specifies the distribution strategy of the queue, with optional values of integers 0, 1, 2:
0: Allocate in rotation according to the order of agents' login for the day;
1: Allocate according to the minimum number of calls answered by the agent for the day, i.e., the higher the priority, the fewer calls answered;
2: Allocate according to the last idle time of the agent, i.e., the longer the idle time, the higher the priority;
Example
Request
URL: http://ip:port/ccapi/v2/queues?AppId={{appid}}&Timestamp={{mytime}}&Sign={{Sign}}&Sid={{Sid}}
BODY:
{
"QueueId":"9009"
}
Response
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": null
}
Request Parameters
Headers
Parameter Name | Parameter Value | Required | Example | Remarks |
---|---|---|---|---|
Content-Type | application/json | Yes |
Query
Parameter Name | Required | Example | Remarks |
---|---|---|---|
AppId | Yes | 4b8dc715-05e0-4340-6cae-a6e3c39a6012 | Application ID |
Body
Name | Type | Required | Default Value | Remarks | Other Information |
---|---|---|---|---|---|
QueueId | string | Required | Queue ID | mock: 9009 | |
QueueName | string | Not Required | Queue Name | mock: test create Queue007 | |
Strategy | integer | Not Required | Queue distribution strategy | ||
Timeout | integer | Not Required | Queuing wait timeout | ||
WaitMusic | string | Not Required | Music played while queuing |
Return Data
Name | Type | Required | Default Value | Remarks | Other Information |
---|---|---|---|---|---|
ErrCode | string | Not Required | Response Code | mock: 000000 | |
ErrDesc | string | Not Required | Response Description | mock: OK | |
Result | string | Not Required | Response Result | mock: |
14. Delete Queue
Basic Information
Path: /ccapi/v2/queues
Method: DELETE
Interface Description:
Overview
Deletes the specified queue.
Note:
Queues with agents in them cannot be deleted.
Example
Request
URL: http://ip:port/ccapi/v2/queues?AppId={{appid}}&Timestamp={{mytime}}&Sign={{Sign}}&Sid={{Sid}}
BODY:
{
"QueueId":"9009"
}
Response
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": null
}
Request Parameters
Headers
Parameter Name | Parameter Value | Required | Example | Remarks |
---|---|---|---|---|
Content-Type | application/json | Yes |
Query
Parameter Name | Required | Example | Remarks |
---|---|---|---|
AppId | Yes | 4b8dc715-05e0-4340-6cae-a6e3c39a6012 | Application ID |
Body
Name | Type | Required | Default Value | Remarks | Other Information |
---|---|---|---|---|---|
QueueId | string | Required | Queue ID | mock: 9009 |
Response Data
Name | Type | Required | Default Value | Remarks | Other Information |
---|---|---|---|---|---|
ErrCode | string | Not Required | Response Code | mock: 000000 | |
ErrDesc | string | Not Required | Response Description | mock: OK | |
Result | string | Not Required | Response Result | mock: |
15. Batch Add Agents to Queue
Basic Information
Path: /ccapi/v2/queues/agents
Method: POST
Interface Description:
Overview
This interface allows for the batch addition of agents to a specified queue.
Note:
This is an incremental operation and will not affect the agents already in the queue.
Example
Request
URL: http://ip:port/ccapi/v2/queues/agents?AppId={{appid}}&Timestamp={{mytime}}&Sign={{Sign}}&Sid={{Sid}}
BODY:
{
"QueueId":"9009",
"AgentIds":[
"9009",
"9008",
"9007",
"9006"
]
}
Response
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": null
}
Request Parameters
Headers
Parameter Name | Parameter Value | Required | Example | Notes |
---|---|---|---|---|
Content-Type | application/json | Yes |
Query
Parameter Name | Required | Example | Notes |
---|---|---|---|
AppId | Yes | 4b8dc715-05e0-4340-6cae-a6e3c39a6012 | Application ID |
Body
Name | Type | Required | Default Value | Notes | Other Information |
---|---|---|---|---|---|
QueueId | string | Required | Queue ID | mock: 9009 | |
AgentIds | string[] | Required | List of Agent IDs | item type: string | |
├─ | Not Required |
Response Data
Name | Type | Required | Default Value | Notes | Other Information |
---|---|---|---|---|---|
ErrCode | string | Not Required | Response Code | mock: 000000 | |
ErrDesc | string | Not Required | Response Description | mock: OK | |
Result | string | Not Required | Response Result | mock: |
16. Batch Agent Queue Enrollment
Basic Information
Path: /ccapi/v2/agents/queues
Method: POST
Interface Description:
Overview
This interface is used to batch-enroll specified agents into queues.
Note:
The parameter 'IsFull' is set to 0 by default, and the interface performs an incremental operation, which does not affect the agent's original queue list;
When the parameter 'IsFull' is set to 1, the interface performs a full operation, which can be used for queue information synchronization with third-party systems.
Example
Request
URL: http://ip:port/ccapi/v2/agents/queues?AppId={{appid}}&Timestamp={{mytime}}&Sign={{Sign}}&Sid={{Sid}}
BODY:
{
"AgentId":"9415",
"Queues":[
"551",
"114"
],
"IsFull":1
}
Response
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": null
}
Request Parameters
Headers
Parameter Name | Parameter Value | Mandatory | Example | Remarks |
---|---|---|---|---|
Content-Type | application/json | Yes |
Query
Parameter Name | Mandatory | Example | Remarks |
---|---|---|---|
AppId | Yes | 4b8dc715-05e0-4340-6cae-a6e3c39a6012 | Application ID |
Body
Name | Type | Mandatory | Default Value | Remarks | Other Information |
---|---|---|---|---|---|
AgentId | string | Required | Agent ID | mock: 1443 | |
Queues | string[] | Required | Queue ID List | item type: string | |
├─ | Not Required | ||||
IsFull | integer | Not Required | Whether to fully update |
Response Data
Name | Type | Mandatory | Default Value | Remarks | Other Information |
---|---|---|---|---|---|
ErrCode | string | Not Required | Response Code | mock: 000000 | |
ErrDesc | string | Not Required | Response Description | mock: OK | |
Result | string | Not Required | Response Result | mock: |
17. Batch Agent Dequeue
Basic Information
Path: /ccapi/v2/agents/queues
Method: DELETE
Interface Description:
Overview
This interface allows for the batch removal of agents from specified queues.
Example
Request
URL: http://ip:port/ccapi/v2/agents/queues?AppId={{appid}}&Timestamp={{mytime}}&Sign={{Sign}}&Sid={{Sid}}
BODY:
{
"AgentId":"9415",
"Queues":[
"551",
"114"
]
}
Response
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": null
}
Request Parameters
Headers
Parameter Name | Parameter Value | Required | Example | Notes |
---|---|---|---|---|
Content-Type | application/json | Yes |
Query
Parameter Name | Required | Example | Notes |
---|---|---|---|
AppId | Yes | 4b8dc715-05e0-4340-6cae-a6e3c39a6012 | Application ID |
Body
Name | Type | Required | Default Value | Notes | Other Information |
---|---|---|---|---|---|
AgentId | string | Required | Agent ID | mock: 1443 | |
Queues | string[] | Required | Queue IDs | item type: string |
Response Data
Name | Type | Required | Default Value | Notes | Other Information |
---|---|---|---|---|---|
ErrCode | string | Not Required | Response Code | mock: 000000 | |
ErrDesc | string | Not Required | Response Description | mock: OK | |
Result | string | Not Required | Response Result | mock: null |
18. Subscription to Events
Basic Information
Path: /ccapi/v2/subscriptions
Method: POST
Interface Description:
Overview
Subscribe to events, and when the subscribed events occur, relevant messages will be sent to the specified callback address.
The callback address is set through the background.
Details of the Events parameter are as follows:
category | all_type | remarks |
---|---|---|
agent_state | acd_agent_state | Agent state event |
ext_state | extension_state_update | Extension state event |
agent_call_mode | agent_call_mode_change | Agent's extension mode switch event |
call | general_hangup | Hangup message |
enqueue_succ | Successful queue entry | |
record_stop | Recording end | |
hangup_cause | Hangup cause event | |
dequeue_succ | Dequeue message | |
start_dialout | Start dialing out | |
voice_mail_succ | Successful voicemail | |
play_succ | Successful playback | |
dtmf_gather_succ | Keypad input | |
asr_gather_succ | Successful voice recognition | |
consult_succ | Successful consultation | |
end_consult_succ | Successful consultation cancellation | |
three_way_succ | Successful three-way call | |
substitute_succ | Successful interception | |
hold_agent_succ | Successful hold | |
extern_succ | Successful transfer to external line | |
eavesdrop_succ | Successful eavesdropping |
Example
Request
URL: http://ip:port/ccapi/v2/subscriptions?AppId={{appid}}&Timestamp={{mytime}}&Sign={{Sign}}&Sid={{Sid}}
BODY:
{
"subscriptions":[
{
"callback":"http://s-km5.udesk.cn/as/api/v1/dialog/6/c6d4c463-5c60-43ba-a522-c972dd60e058",
"events":["begin","end"],
"name":"lymtest"
}
]
}
Response
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": {
"sub_succ": [
{
"subid": 168,
"name": "test"
}
],
"sub_fail": null
}
}
Request Parameters
Headers
Parameter Name | Parameter Value | Required | Example | Remarks |
---|---|---|---|---|
Content-Type | application/json | Yes |
Query
Parameter Name | Required | Example | Remarks |
---|---|---|---|
AppId | Yes | 4b8dc715-05e0-4340-6cae-a6e3c39a6012 | Application ID |
Timestamp | Yes | 1566523582 | Timestamp |
Body
Name | Type | Required | Default Value | Remarks | Other Information |
---|---|---|---|---|---|
subscriptions | object | Required | |||
├─ callback | string | Required | Callback address | mock: "http://ip:port" | |
├─ events | string[] | Required | List of event names (see remarks) | item type: string | |
├─ | Not Required | ||||
├─ name | string | Required | Subscription name |
Return Data
Name | Type | Required | Default Value | Remarks | Other Information |
---|---|---|---|---|---|
ErrCode | string | Not Required | Response code | mock: 000000 | |
ErrDesc | string | Not Required | Response description | mock: OK | |
Result | object | Not Required | Response result | ||
├─ sub_succ | object | Not Required | Subscription result Success | ||
├─ subid | integer | Not Required | id | ||
├─ name | string | Not Required | Subscription name | ||
├─ sub_fail | string[] | Not Required | Subscription result Failure | item type: string | |
├─ | Not Required | "" |
19. Update Event Subscription
Basic Information
Path: /ccapi/v2/subscriptions/{id}
Method: PUT
Interface Description:
Overview
Update the subscribed events.
Example
Request
URL: http://ip:port/ccapi/v2/subscriptions/{id:[0-9]+}?AppId={{appid}}&Timestamp={{mytime}}&Sign={{Sign}}&Sid={{Sid}}
BODY:
{
"callback":"https://qa.udesk.cn/api/v2/middleware/",
"name":"ymtest111",
"events":["acd_agent_state"],
"enable":false
}
Response
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": {
"ymtest111": 164
}
}
Request Parameters
Headers
Parameter Name | Parameter Value | Required | Example | Remarks |
---|---|---|---|---|
Content-Type | application/json | Yes |
Path Parameters
Parameter Name | Example | Remarks |
---|---|---|
id | 73 | {id:[0-9]+} |
Query
Parameter Name | Required | Example | Remarks |
---|---|---|---|
AppId | Yes | 4b8dc715-05e0-4340-6cae-a6e3c39a6012 | Application ID |
Timestamp | Yes | 1566523582 | Timestamp |
Body
Name | Type | Required | Default | Remarks | Other Information |
---|---|---|---|---|---|
callback | string | Required | Callback URL | ||
name | string | Required | Subscription Name | ||
events | string[] | Required | Event List | Item Type: string | |
├─ | Not Required | ||||
enable | boolean | Required | Subscription Flag true: enable; false: disable. |
Return Data
Name | Type | Required | Default | Remarks | Other Information |
---|---|---|---|---|---|
ErrCode | string | Not Required | Response Code | ||
ErrDesc | string | Not Required | Response Description | ||
Result | object | Not Required | Response Result | ||
├─ ymtest111 | number | Not Required | Subscription Name & Event ID |
20. Delete Event
Basic Information
Path: /ccapi/v2/subscriptions/{id}
Method: DELETE
Interface Description:
Overview
Unsubscribe from an already subscribed event.
Example
Request
URL: http://ip:port/ccapi/v2/subscriptions/{id:[0-9]+}?AppId={{appid}}&Timestamp={{mytime}}&Sign={{Sign}}&Sid={{Sid}}
Response
{
"ErrCode":"000000",
"ErrDesc":"OK",
"Result":[]
}
Request Parameters
Headers
Parameter Name | Parameter Value | Required | Example | Notes |
---|---|---|---|---|
Content-Type | application/x-www-form-urlencoded | Yes |
Path Parameters
Parameter Name | Example | Notes |
---|---|---|
id | 73 | {id:[0-9]+} |
Query
Parameter Name | Required | Example | Notes |
---|---|---|---|
AppId | Yes | 4b8dc715-05e0-4340-6cae-a6e3c39a6012 | Application ID |
Timestamp | Yes | 1566523582 | Timestamp |
Body
Name | Type | Required | Default | Notes | Other Information |
---|
Response Data
Name | Type | Required | Default | Notes | Other Information |
---|---|---|---|---|---|
ErrCode | string | Not Required | Response Code | mock: 000000 | |
ErrDesc | string | Not Required | Response Description | mock: OK | |
Result | string[] | Not Required | Response Result | Item Type: string | |
├─ | Not Required |
21. Get Event List
Basic Information
Path: /ccapi/v2/subscriptions
Method: GET
Interface Description:
Overview
Obtain a list of subscribed events.
Example
Request
URL: http://ip:port/ccapi/v2/subscriptions?AppId={{appid}}&Timestamp={{mytime}}&Sign={{Sign}}&Sid={{Sid}}
Response
{
"ErrCode":"000000",
"ErrDesc":"OK",
"Result":{
"callback":"http://ip:port",
"enable":"false",
"events":["acd_agent_state"],
"name":"sub1"
}
}
Request Parameters
Query
Parameter Name | Required | Example | Remarks |
---|---|---|---|
AppId | Yes | 4b8dc715-05e0-4340-6cae-a6e3c39a6012 | Application ID |
Return Data
Name | Type | Required | Default | Remarks | Other Information |
---|---|---|---|---|---|
ErrCode | string | Not Required | Response Code | ||
ErrDesc | string | Not Required | Response Description | ||
Result | object | Not Required | Response Result | ||
├─ callback | string | Not Required | Callback URL | mock: http://ip:port | |
├─ enable | string | Not Required | Subscription Status | mock: true enables; false disables | |
├─ events | string[] | Not Required | Events | item type: string | |
├─ | Not Required | ||||
├─ name | string | Not Required | Tenant's Name |
22. Agent Sign-In
Basic Information
Path: /ccapi/v2/agent/login
Method: POST
Interface Description:
Overview
Sign in a specified agent.
Note:
- Only signed-in agents can answer or make outgoing calls;
- Agents without an extension bound cannot sign in;
- The 'Set to Idle, Offline' operation in the front-end SDK is accompanied by sign-in and sign-out operations.
Example
Request
URL: http://ip:port/ccapi/v2/agent/login?AppId={{appid}}&Timestamp={{mytime}}&Sign={{Sign}}&Sid={{Sid}}
BODY:
{
"agent_id":"10032"
}
Response
{
"ErrCode": "000000",
"ErrDesc": "OK",
"msg_id": "111",
"results": "",
"data": null
}
Request Parameters
Headers
Parameter Name | Parameter Value | Required | Example | Remarks |
---|---|---|---|---|
Content-Type | application/json | Yes |
Query
Parameter Name | Required | Example | Remarks |
---|---|---|---|
MsgId | Yes | 111 | MsgId sent during sign-in |
AppId | Yes | a54a8b77-f12d-4ac9-742d-5b2bef5c4d11 | Application ID |
Body
Name | Type | Required | Default Value | Remarks | Other Information |
---|---|---|---|---|---|
agent_id | string | Required | Agent ID | mock: 10032 | |
work_id | string | Not Required | Agent job number | mock: 22 | |
queue_ids | string[] | Not Required | Queue identifier array (specifically used for reporting to NSQ) | item type: string | |
├─ | Not Required | ||||
state | integer | Not Required | Agent status after going online, 0: 'Idle', 1: 'Waiting' |
Return Data
Name | Type | Required | Default Value | Remarks | Other Information |
---|---|---|---|---|---|
ErrCode | string | Not Required | Response Code | ||
ErrDesc | string | Not Required | Response Description | ||
msg_id | string | Not Required | MsgId sent during sign-in | ||
results | string | Not Required | Response Results | ||
data | string | Not Required | Data |
23. Agent Logout
Basic Information
Path: /ccapi/v2/agent/logout
Method: POST
Interface Description:
Overview
Logs out the specified agent.
Note:
- Only an agent who has checked in can answer or make outgoing calls;
- Incoming calls in the queue will not be distributed to agents who have checked out.
Example
Request
URL: http://ip:port/ccapi/v2/agent/logout?app_id={{appid}}&Sign={{Sign}}&Timestamp={{mytime}}&Sid={{Sid}}
BODY:
{
"agent_id":"1802"
}
Response
{
"ErrCode": "000000",
"ErrDesc": "OK",
"msg_id": "111",
"results": "",
"data": null
}
Request Parameters
Headers
Parameter Name | Parameter Value | Required | Example | Remarks |
---|---|---|---|---|
Content-Type | application/json | Yes |
Query
Parameter Name | Required | Example | Remarks |
---|---|---|---|
MsgId | No | The MsgId sent during sign-in | |
app_id | Yes | Application ID |
Body
Name | Type | Required | Default Value | Remarks | Other Information |
---|---|---|---|---|---|
agent_id | string | Required | Agent ID | mock: 10032 |
Response Data
Name | Type | Required | Default Value | Remarks | Other Information |
---|---|---|---|---|---|
ErrCode | string | Not Required | Response Code | ||
ErrDesc | string | Not Required | Response Description | ||
msg_id | string | Not Required | The MsgId sent during logout | ||
results | string | Not Required | Response Results | ||
data | string | Not Required | Data |
24. Callback User to IVR
Basic Information
Path: /ccapi/v2/callback2ivr
Method: POST
Interface Description:
Overview
This interface initiates a call to a user, and once the call is connected, it follows the same inbound process, i.e., finding the IVR through routing.
The request requires the same authentication method as other openAPIs, with the tenant ID and the corresponding signature string in the parameter list.
Example
Request
URL: http://ip:port/ccapi/v2/callback2ivr?app_id={{appid}}&Sign={{Sign}}&Timestamp={{mytime}}&Sid={{Sid}}
{
"caller":"18789998765",
"called":"02863208944",
"called_display":"02863208944"
}
Response
{
"code": "000000",
"message": "OK",
"results": "c9d52506-c41b-431f-5fa0-b701a81a2da6"
}
Request Parameters
Headers
Parameter Name | Parameter Value | Required | Example | Remarks |
---|---|---|---|---|
Content-Type | application/json | Yes |
Query
Parameter Name | Required | Example | Remarks |
---|---|---|---|
app_id | Yes | a54a8b77-f12d-4ac9-742d-5b2bef5c4d11 | Tenant id |
Body
Name | Type | Required | Default Value | Remarks | Other Information |
---|---|---|---|---|---|
caller | string | Required | The target customer number to callback | ||
called | string | Required | Relay number | ||
called_display | string | Required | Display number (usually the relay number) | ||
variables | string | Not Required | Custom variables carried with the call (can be used as variables in IVR configuration) "[{"key/": "extemalNumber","type":"string","value":"13800000000"}]" |
Return Data
Name | Type | Required | Default Value | Remarks | Other Information |
---|---|---|---|---|---|
code | string | Not Required | Return code | ||
message | string | Not Required | Error message | ||
results | string | Not Required | Response result |
25. Get Agent Information
Basic Information
Path: /ccapi/v2/agents/{id}
Method: GET
Interface Description:
Overview
This interface can be used to obtain the current status, employee number, assigned queue, sub-status, and extension information of the agent.
The request requires the same authentication method as other openAPIs, and the parameter list should include the tenant ID and the corresponding signature string.
Example
Request
URL: http://ip:port/ccapi/v2/agents/355?AppId={{appid}}&Sign={{Sign}}&Timestamp={{mytime}}&Sid={{Sid}}
Response
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": {
"AppId": "xxx",
"AgentId": "355@7859ff65-0e6a",
"WorkId": "111",
"Name": "alice",
"NickName": "alice",
"Mobile": "1327766543",
"Email": "aaaa@test.cn",
"Role": "agent",
"Queues": [
"2@7859ff65-0e6a"
],
"QueuesNames": [
"A"
],
"Extensions": [
"1145","1146"
],
"DefSpNumber": "0107766",
"State": 4,
"StateDes": "offline",
"ReasonCode": 0,
"ReasonCodeDes": "",
"ExtState": 0,
"Enable": true,
"ExtenInfos": [
{"Number":"","Extension":"1145","Password":"xxx","SignalType":"voip"}
]
}
}
Request Parameters
Path Parameters
Parameter Name | Required | Example | Remarks |
---|---|---|---|
id | Yes | 355 | Agent ID |
Query
Parameter Name | Required | Example | Remarks |
---|---|---|---|
AppId | Yes | a54a8b77-f12d-4ac9-742d-5b2bef5c4d11 | Tenant ID |
Response Data
Name | Type | Required | Default | Remarks | Other Information |
---|---|---|---|---|---|
ErrCode | string | Required | Response Code | mock: 000000 | |
ErrDesc | string | Required | Response Description | mock: OK | |
Result | string | Not Required | Response Result | mock: |
26. Get Queue Agent List
Basic Information
Path: /ccapi/v2/queues/agents_list/{queue_id}
Method: GET
Interface Description:
Overview
This interface allows you to specify the list of agents for a queue.
The request requires the same authentication method as other openAPIs, and the parameter list should include the tenant ID and the corresponding generated signature string.
Example
Request
URL: http://ip:port/ccapi/v2/queues/agents_list/3?AppId={{appid}}&Sign={{Sign}}&Timestamp={{mytime}}&Sid={{Sid}}
Response
{
"ErrCode": "000000",
"ErrDesc": "OK",
"Result": [
{
"AppId": "xxx",
"AgentId": "355@7859ff65-0e6a",
"WorkId": "111",
"Name": "alice",
"NickName": "alice",
"Mobile": "1327766543",
"Email": "aaaa@test.cn",
"Role": "agent",
"Queues": [
"2@7859ff65-0e6a"
]
"QueuesNames": [
"A"
]
"Extensions": [
"1145","1146"
]
"DefSpNumber": "0107766",
"State": 4,
"StateDes": "offline",
"ReasonCode": 0,
"ReasonCodeDes": "",
"ExtState": 0,
"Enable": true,
"ExtenInfos": [
{"Number":"","Extension":"1145","Password":"xxx","SignalType":"voip"}
]
}
]
}
Request Parameters
Path Parameters
Parameter Name | Required | Example | Remarks |
---|---|---|---|
id | Yes | 3 | Queue ID |
Query
Parameter Name | Required | Example | Remarks |
---|---|---|---|
AppId | Yes | a54a8b77-f12d-4ac9-742d-5b2bef5c4d11 | Tenant ID |
Return Data
Name | Type | Required | Default | Remarks | Other Information |
---|---|---|---|---|---|
ErrCode | string | Required | Response Code | mock: 000000 | |
ErrDesc | string | Required | Response Description | mock: OK | |
Result | string | Not Required | Response Result | mock: |