Create Automatic Callout Task
This interface is used to create an automatic callout task.
Request Method
POST /cc_ad_tasks
Request Parameters
Attribute Name | Type | Required | Description |
---|---|---|---|
name | String | Yes | Name of the callout task |
description | String | No | Description of the callout task |
task_type | Integer | Yes | Type of the callout task, see Task Type |
user_group_id | Integer | Yes | Customer service group ID for the callout task |
force_policy_id | Integer | No | Routing policy ID, determines which intelligent routing to use for this phone. Default routing |
priority | Integer | No | Priority (1-100), default 10 |
working_time_id | Integer | No | Task execution time period work time ID |
recall_policy | String | No | Types of call results that trigger redial, see Data Structure - Call Result Type List |
recall_count | Integer | No | Number of redials, default 0 |
recall_interval | String | No | Redial interval, format "1,2,3" first 60 seconds, second 120 seconds, third 180 seconds, default 600 seconds |
follow_on_policy | String | No | Types of call results that trigger follow-up calls, see Data Structure - Call Result Type List |
callout_number | String | No | Relay number (outbound display number) |
call_limit | String | No | Number of tasks in parallel, cannot exceed the number of tasks concurrently limited by callout_number |
Response Data
Attribute Name | Type | Description |
---|---|---|
code | Integer | Execution result code, 1000 represents success |
id | Integer | Callout task ID |
Example
curl https://demo.udesk.cn/open_api_v1/cc_ad_tasks?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
\
-X POST \
-H 'content-type: application/json' \
-d '
{
"name": "Callout Task",
"description": "This is a callout task",
"task_type": 1,
"user_group_id": 100,
"force_policy_id": 1,
"priority": 10,
"working_time_id": 1,
"recall_policy": "customer_missed",
"recall_count": 6,
"recall_interval": "1,2,3,4,5,6",
"follow_on_policy": "customer_missed",
"callout_number": "021002002020",
"call_limit": "10"
}'
Response
{
"code": 1000,
"id": 1
}
Update Automatic Callout Task
This interface is used to update the name and description of an automatic callout task.
Request Method
PUT /cc_ad_tasks/:id
Request Parameters
Attribute Name | Required | Description |
---|---|---|
name | Yes | Callout task name |
description | No | Callout task description |
callout_number | No | Relay number (outbound display number) |
call_limit | No | Number of tasks in parallel |
Response Data
Attribute Name | Type | Description |
---|---|---|
code | Integer | Execution result code, 1000 represents success |
Example
curl https://demo.udesk.cn/open_api_v1/cc_ad_tasks/1?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
\
-X PUT \
-H 'content-type: application/json' \
-d '
{
"name": "Modified Callout Task",
"description": "This is the modified callout task",
"callout_number": "021002002020",
"call_limit": "10"
}'
Response
{
"code": 1000
}
Get Automatic Callout Task List
This interface is used to obtain an automatic callout task list.
Request Method
GET /cc_ad_tasks
Request Parameters
Parameter Name | Required | Description |
---|---|---|
page | No | Pagination page number, starting from 1, default to 1 |
per_page | No | Number of items per page, default to 10, max to 100 |
Response Data
Attribute Name | Type | Description |
---|---|---|
code | Integer | Execution result code, 1000 represents success |
cc_ad_tasks | Array | Automatic callout task information, see Data Structure - Automatic Callout Task |
meta | Object | Pagination information, see General Data |
Example
curl https://demo.udesk.cn/open_api_v1/cc_ad_tasks?page=1&per_page=10&email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
Response
{
"code": "1000",
"cc_ad_tasks": [
{
"id": 1,
"name": "Automatic Callout",
"description": "Description of automatic callout task",
"task_type": 2,
"user_group_id": 100,
"customer_count": 100000,
"callout_number": "057126200039",
"created_at": "2017-10-21 11:22:33",
"status": 1,
"execute_customer_count": 100000,
"customer_answer_count": 100000,
"agent_answer_count": 100000,
"call_success_rate": "1.0",
"agent_answer_rate": "1.0",
"agent_use_rate": "1.0",
"disturb_rate": "0.0",
"minute_call_rate": "1.0",
"minute_agent_use_rate": "1.0",
"minute_disturb_rate": "0.0"
}
],
"meta": {
"current_page": 1,
"total_pages":1,
"total_entries": 1
}
}
Get Automatic Callout Task Details
This interface is used to query the details of a single callout task.
Request Method
GET /cc_ad_tasks/:id
Response Data
Attribute Name | Type | Description |
---|---|---|
code | Integer | Execution result code, 1000 represents success |
item | Object | Callout task information, see Data Structure - Automatic Callout Task Details |
Example
curl https://demo.udesk.cn/open_api_v1/cc_ad_tasks/1?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
Response
{
"code": 1000,
"item": {
"id": 16,
"name": "Waiting for callout",
"status": 2,
"call_limit": 10,
"callout_number": "05712620039",
"task_type": 1,
"force_policy_id": 45,
"user_group_id": 323,
"description": null,
"created_at": "2017-11-02T20:13:40.000+08:00",
"schedule_id": null,
"redial_times": 0,
"redial_guide": ["1", "1"],
"redial_scene": ["phone_busy", "phone_outline"],
"redial_multi_scene": ["phone_busy"],
"priority": 10,
"force_policy_name": "Automatic callout",
"schedule_name": null,
"customer_count": 2,
"execute_customer_count": 6,
"customer_answer_count": 0,
"agent_answer_count": 0,
"call_success_rate": "0.0",
"agent_answer_rate": "0",
"agent_use_rate": "0.0",
"disturb_rate": "0",
"minute_call_rate": "1.0",
"minute_agent_use_rate": "0.0",
"minute_disturb_rate": "0.0"
}
}
Import Numbers for Automatic Callout Task
This interface is used to add numbers to a specified automatic callout task. Up to 300 numbers can be imported each time, and the calling frequency should not exceed 1 time per second.
Request Method
POST /cc_ad_tasks/add_numbers
Content Type
application/json
Request Parameters
Attribute Name | Required | Type | Description |
---|---|---|---|
id | Yes | Integer | Automatic callout task ID |
numbers | Yes | Array | Array of numbers to add, see Data Structure - Import Automatic Callout Number Structure |
Response Data
Attribute Name | Type | Description |
---|---|---|
code | Integer | Execution result code, 1000 represents success |
successful_count | Integer | Number of successfully imported numbers |
unsuccessful_count | Integer | Number of unsuccessfully imported numbers |
unsuccessful_numbers | Array | List of unsuccessfully imported numbers, see Data Structure - Import Failed Number Structure |
Example
curl https://demo.udesk.cn/open_api_v1/cc_ad_tasks/add_numbers?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
\
-X POST \
-H 'content-type: application/json' \
-d '
{
"id": 1,
"numbers": [
{"cellphone": "13223004567", "name": "Test number 1", "description": "Number description 1"},
{"cellphone": "13223004568", "name": "Test number 2", "description": "Number description 2"},
{"cellphone": "13223004569", "name": "Test number 3", "description": "Number description 3",
"custom": {"company": "Udesk", "address": "Beijing City"}
}
]
}'
Response
{
"code": 1000,
"successful_count": 3,
"unsuccessful_count": 0,
"unsuccessful_numbers": []
}
Notes
- Automatic callout tasks can only add numbers when they are closed.
- Please note the number pool quota: Each API import is limited to adding up to 300 numbers, each automatic callout task is limited to 1 million numbers, and each company is limited to 10 million numbers.
- The frequency of adding numbers API calls should not exceed 1 time per second.
Get Automatic Callout Task Number Pool
This interface is used to return the number pool list for a specified automatic callout task, with a maximum of 500 records returned each time.
Request Method
GET /cc_ad_tasks/numbers
Request Parameters
Parameter Name | Required | Type | Description |
---|---|---|---|
id | Yes | Integer | Automatic callout task ID |
start_number_id | No | Integer | Starting number pool number ID, default to 0, note: only return numbers with an ID greater than this value |
Response Data
Attribute Name | Type | Description |
---|---|---|
code | Integer | Execution result code, 1000 represents success |
numbers | Array | Returned number list details, see Data Structure - Number Pool Structure |
meta | Object | Additional information, see Data Structure - Number Pool Additional Information |
Example
curl https://demo.udesk.cn/open_api_v1/cc_ad_tasks/numbers?id=12292&start_number_id=2&email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
Response
{
"code": 1000,
"numbers": [
{
"id": 3,
"name": "Test Number 3",
"cellphone": "13989001200",
"description": "Description of Number 3",
"call_count": 0,
"customer_answer_count": 0,
"agent_answer_count": 0
},
{
"id": 14,
"name": "Test Number 14",
"cellphone": "13989001201",
"description": "Description of Number 14",
"call_count": 0,
"customer_answer_count": 0,
"agent_answer_count": 0
}
],
"meta": {
"record_size": 2,
"max_number_id": 14
}
}
Automatic Callout Task Number Redial
This interface is used to redial a specific number for an automatic callout task.
Request Method
POST /cc_ad_tasks/recall
Request Parameters
Parameter Name | Required | Type | Description |
---|---|---|---|
id | Yes | Integer | Callout task ID |
number | Yes | String | Redial phone number |
after_at | Yes | String | Redial start time, format YYYY-MM-DDTHH:MM:SSZ |
Response Data
Attribute Name | Type | Description |
---|---|---|
code | Integer | Execution result code, 1000 represents success |
message | String | Execution result explanation |
Example
curl https://demo.udesk.cn/open_api_v1/cc_ad_tasks/recall?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
\
-X POST \
-H 'content-type: application/json' \
-d '
{
"id":1,
"number":"13412341234",
"after_at":"2019-02-08T15:30:02+08:00"
}'
Response
{
"code": 1000,
"message": "Redial successful"
}
Automatic Callout Task Number Follow-up
This interface is used to initiate a follow-up call for a specific number in an automatic callout task.
Request Method
POST /cc_ad_tasks/follow_on
Request Parameters
Parameter Name | Required | Type | Description |
---|---|---|---|
id | Yes | Integer | Callout task ID |
called | Yes | String | Already dialed phone number |
Response Data
Attribute Name | Type | Description |
---|---|---|
code | Integer | Execution result code, 1000 represents success |
message | String | Execution result explanation |
Example
curl https://demo.udesk.cn/open_api_v1/cc_ad_tasks/follow_on?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
\
-X POST \
-H 'content-type: application/json' \
-d '
{
"id": 1,
"called": "13223004570"
}'
Response
{
"code": 1000,
"message": "Follow-up successful"
}
Outbound Call Task Start/Stop
Request Method
POST /cc_ad_tasks/:id/open
Request Parameters
Parameter Name | Required | Type | Description |
---|---|---|---|
open | Yes | Boolean | true/false |
callout_number | No | String | Relay number |
Response
Attribute Name | Type | Description |
---|---|---|
code | Integer | Result code, 1000 represents success |
message | String | Result explanation |
Example
curl https://demo.udesk.cn/open_api_v1/cc_ad_tasks/1/open?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
\
-X POST \
-H 'content-type: application/json' \
-d '
{
"open": true/false,
"callout_number": "01086465047"
}'
Response
{
"code": 1000
}
Data Structure - Automatic Outbound Call Task
Attribute | Description | Example | Type |
---|---|---|---|
id | Task ID | 1 | Integer |
name | Task Name | 'Automatic Outbound Call' | String |
description | Task Description | 'This is an automatic outbound call task' | String |
task_type | Task Type | 1 | Integer |
callout_number | Outbound Call Number | "01086465047" | String |
user_group_id | Customer Service Group ID | 100 | Integer |
customer_count | Number of Customers | 100000 | Integer |
created_at | Creation Time | '2017-11-22 10:32:33' | DateTime |
status | Status | 1 | Integer |
execute_customer_count | Executed Count | 100000 | Integer |
customer_answer_count | Customer Answer Count | 100000 | Integer |
agent_answer_count | Agent Answer Count | 100000 | Integer |
call_success_rate | Outbound Call Success Rate | '0.67' | String |
agent_answer_rate | Agent Answer Rate | '0.32' | String |
disturb_rate | Disturbance Rate | '0.0' | String |
agent_use_rate | Agent Utilization Rate | '1.0' | String |
minute_call_rate | 10-Minute Connection Rate | '1.0' | String |
minute_agent_use_rate | 10-Minute Disturbance Rate | '1.0' | String |
minute_disturb_rate | 10-Minute Agent Utilization Rate | '1.0' | String |
Task Type Description (task_type)
Value | Chinese Name |
---|---|
1 | Precision Outbound Call |
2 | Proportion Outbound Call |
3 | Predictive Outbound Call |
4 | Simple IVR (Voice Broadcast, No Queue) |
Status Description (status)
Value | Chinese Name |
---|---|
1 | Enabled |
2 | Disabled |
3 | Stopping |
Data Structure - Import Automatic Outbound Call Numbers
Attribute | Type | Description | Required |
---|---|---|---|
cellphone | String | Phone number, multiple numbers can be separated by commas | Yes |
name | String | Name | No |
description | String | Description | No |
custom | Object | Custom data, see the structure in Data Structure - Custom Data for Importing Automatic Outbound Call Numbers | No |
Data Structure - Failed Import Number Structure
Attribute | Type | Description |
---|---|---|
cellphone | String | Phone number |
name | String | Name |
description | String | Description |
custom | Object | Custom data |
reason | String | Reason for failure |
Data Structure - Number Pool Structure
Attribute | Type | Description |
---|---|---|
id | Integer | Number ID |
name | String | Name |
cellphone | String | Phone number |
description | String | Description |
call_count | Integer | Number of calls |
customer_answer_count | Integer | Number of times the customer answered |
agent_answer_count | Integer | Number of times the agent answered |
Data Structure - Additional Number Pool Information
Attribute | Type | Description |
---|---|---|
record_size | Integer | The number of numbers returned in the current request |
max_number_id | Integer | The maximum number ID returned in the current request (null when record_size is 0), can be used as the start_number_id for the next request |
Data Structure - Custom Data for Importing Automatic Outbound Call Numbers
The number of custom fields cannot exceed 10.
Attribute | Type | Description | Required |
---|---|---|---|
Field 1 | String | The field name can be customized | Yes |
Field 2 | String | The field name can be customized | No |
Field 3 | String | The field name can be customized | No |
.... | String | The field name can be customized | No |
Field 10 | String | The field name can be customized | No |
Data Structure - Call Result Type List
Value | Chinese Name |
---|---|
customer_missed | Customer Missed |
agent_missed | Agent Missed |
customer_breakout | Customer Breakout |
phone_outline | Phone Offline |
phone_busy | Phone Busy |
Data Structure - Automatic Outbound Call Task Details
Attribute | Description | Example | Type |
---|---|---|---|
id | Task ID | 1 | Integer |
name | Task Name | 'Automatic Outbound Call' | String |
status | Status | 1 | Integer |
call_limit | Concurrent Call Limit | 1 | Integer |
callout_number | Outbound Call Number | "01086465047" | String |
task_type | Task Type | 1 | Integer |
force_policy_id | Routing Policy ID | 1 | Integer |
user_group_id | Customer Service Group ID | 100 | Integer |
description | Task Description | 'This is an automatic outbound call task' | String |
created_at | Creation Time | '2017-11-22 10:32:33' | DateTime |
schedule_id | Work Time ID | 1 | Integer |
redial_times | Redial Attempts | 0 | Integer |
redial_guide | Redial Interval | ["1", "1"] | Array |
redial_scene | Redial Policy | ["phone_busy", "phone_outline"] | Array |
redial_multi_scene | Continuation Call Policy | ["phone_busy"] | Array |
priority | Priority | 10 | Integer |
force_policy_name | Routing Policy Name | "Automatic Outbound Call" | String |
schedule_name | Work Time Name | "Work Time" | String |
customer_count | Number of Customers | 100000 | Integer |
execute_customer_count | Executed Count | 100000 | Integer |
customer_answer_count | Customer Answer Count | 100000 | Integer |
agent_answer_count | Agent Answer Count | 100000 | Integer |
call_success_rate | Outbound Call Success Rate | '0.67' | String |
agent_answer_rate | Agent Answer Rate | '0.32' | String |
disturb_rate | Disturbance Rate | '0.0' | String |
agent_use_rate | Agent Utilization Rate | '1.0' | String |
minute_call_rate | 10-Minute Connection Rate | '1.0' | String |
minute_agent_use_rate | 10-Minute Disturbance Rate | '1.0' | String |
minute_disturb_rate | 10-Minute Agent Utilization Rate | '1.0' | String |
Error Code Description
Error Code | Message | Exception:message | Description |
---|---|---|---|
2000 | Unknown error | unknown attribute: working_time_id | Parameter {working_time_id} is empty |
undefined method `size' for nil:NilClass | Required parameter {numbers} not imported or is empty | ||
2005 | Resource not found | Couldn't find CcAdTask with id=12 [WHERE cc_ad_tasks .company_id = ?] | Parameter {id} is incorrect, no matching value found |
Couldn't find CcAdTask without an ID | Parameter {id} is incorrect, no matching value found | ||
206203 | Invalid task_type | (Message omitted) | Required parameter {task_type} not filled out or value is out of range |
206204 | Invalid user_group_id | (Message omitted) | Required parameter {user_group_id} not filled out or value is out of range |
206205 | Invalid name | (Message omitted) | Required parameter {name} not filled out or value is out of range |
206206 | Invalid force_policy_id | (Message omitted) | Parameter {force_policy_id} value is out of range |
206207 | Invalid working_time_id | (Message omitted) | Parameter {force_policy_id} value is out of range |
501004 | Cannot import numbers for a task that is starting | (Message omitted) | The automatic outbound call task is in the starting state |
501015 | Parameter open cannot be empty and must be true/false | (Message omitted) | Parameter {open} value is not true or false within the specified range |
501016 | The task is already closing, no need to close again | (Message omitted) | The automatic outbound call task is already in the closed state |
501032 | Invalid number | (Message omitted) | Required parameter {number} not filled out or value is out of range |
501033 | Incorrect redial start time format | (Message omitted) | Required parameter {after_at} not filled out or format is incorrect |
501035 | Automatic outbound call task is starting, no need to start again | (Message omitted) | The automatic outbound call task is already in the started state |
503001 | (Continued) | (Message omitted) | The value of parameter {callout_number} is incorrect, not within the specified range |
503002 | Does not meet the current concurrent call limit for the dialing number | (Message omitted) | The value of parameter {call_limit} exceeds the concurrent call limit of the corresponding relay number |