logo

Get Callout Task List

This interface is used to obtain a list of callout tasks within a specified time range.

Request Method

GET /callout_tasks

Request Parameters

Parameter NameRequiredDescription
start_timeYesStart time
end_timeYesEnd time

Response Data

Attribute NameTypeDescription
codeIntegerExecution result code, 1000 represents success
callout_tasksArray of ObjectsCallout task list information, including task ID, task name, and creation time

Example

curl https://demo.udesk.cn/open_api_v1/callout_tasks?start_time=2017-04-21%2016:34:02&end_time=2018-04-21%2016:34:52&email=admin@udesk.cn&timestamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2

Note: In the curl request, spaces are replaced with "%20". Response

{
    "code": 1000,
    "callout_tasks": [
        {
            "id": 1,
            "name": "Callout Task 1",
            "created_at": "2017-10-11T20:35:37.000+08:00"
        },
        {
            "id": 2,
            "name": "Callout Task 2",
            "created_at": "2017-12-28T11:07:17.000+08:00"
        },
        {
            "id": 3,
            "name": "Callout Task 3",
            "created_at": "2017-12-29T11:35:37.000+08:00"
        }
    ]
}

Get Callout Task Details

This interface is used to obtain information for a specified callout task ID.

Request Method

GET /callout_tasks/:id

Request Parameters (URL)

Parameter NameRequiredDescription
idYesCallout task ID

Response Data

Attribute NameTypeDescription
codeIntegerExecution result code, 1000 represents success
callout_taskObjectCallout task information, as follows
callout_task
Attribute NameTypeDescription
idIntegerUnique identifier
nameStringName
descriptionStringDescription
start_atDateTimeStart time
end_atDateTimeEnd time
created_atDateTimeCreation time
statusIntegerStatus, 0 for enabled, 1 for paused
task_typeIntegerTask type, fixed to pass 0
agent_typeIntegerSeat type, 0 for all customer service, 1 for queue, 2 for custom
distribution_strategyIntegerCustomer seat distribution strategy, 0 (default) for average distribution, 1 for load balancing distribution
queue_idsArrayArray of queue IDs
customersArrayArray of customer identifiers, which can be ID, token, phone, or email, used only for editing and creating
customer_idsArrayArray of customer IDs
agent_idsArrayArray of customer service IDs
customer_countIntegerNumber of customers
executed_countIntegerNumber of connections
success_countIntegerNumber of successful connections
total_executed_countIntegerTotal number of executions
total_success_countIntegerTotal number of successful connections
questionnaire_idIntegerID of the survey questionnaire template bound to the callout task
callout_note_template_idIntegerID of the callout business information template associated with the callout task

Example

curl https://demo.udesk.cn/open_api_v1/callout_tasks/1?email=admin@udesk.cn&timestamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2

Response

{
    "code": 1000,
    "callout_task": {
        "id": 1,
        "name": "CallOutTask",
        "status": 0,
        "description": "Test",
        "created_at": "2017-03-14T14:12:42.000+08:00",
        "customer_ids": [1, 2, 3, 4],
        "agent_ids": [1, 2],
        "start_at": "2015-01-01T00:00:00.000+08:00",
        "end_at": "2015-01-01T23:59:00.000+08:00",
        "task_type": 0,
        "agent_type": 0,
        "queue_ids": null,
        "customer_count": 4,
        "executed_count": 0,
        "success_count": 0,
        "total_executed_count": 0,
        "total_success_count": 0,
        "callout_note_template_id": 1
    }
}

Create Callout Task

This interface is used to create a callout task.

Request Method

POST /callout_tasks

Request Parameters (Request Body)

Attribute NameTypeRequiredDescription
callout_taskObjectYesCallout task information, as follows
callout_task
Attribute NameTypeRequiredDescription
nameStringYesName
descriptionStringOptionalDescription
start_atDateTimeYesStart time
end_atDateTimeYesEnd time
statusIntegerYesStatus, 0 for enabled, 1 for paused
task_typeIntegerYesTask type, fixed to pass 0
agent_typeIntegerYesSeat type, 0 for all customer service, 1 for queue, 2 for custom
distribution_strategyIntegerOptionalCustomer seat distribution strategy, 0 (default) for average distribution, 1 for load balancing distribution
queue_idsArrayOptionalArray of queue IDs
customersArrayOptionalArray of customer identifiers, which can be ID, token, phone, or email, used only for editing and creating
customer_idsArrayYesArray of customer IDs
agent_idsArrayOptionalArray of customer service IDs
questionnaire_idIntegerOptionalID of the survey questionnaire template bound to the callout task
callout_note_template_idIntegerOptionalID of the callout business information template associated with the callout task
hide_numberIntegerOptionalPhone number masking (0: No, 1: Yes, default 0)
is_repeat_customer_taskIntegerOptionalWhether the customer is allowed to repeat in the callout task (0: No, 1: Yes, default 0)
distribution_basisIntegerOptionalBasis for distributing customers (0: Task customer ID, 1: Customer ID, default 0)

Response Data

The same as Get Callout Task Details.

Example

curl https://demo.udesk.cn/open_api_v1/callout_tasks?email=admin@udesk.cn&timestamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
 \
-X POST \
-H 'content-type: application/json' \
-d '
{
    "callout_task": {
        "name": "CallOutTask",
        "description": "Test",
        "agent_type": 0,
        "agent_ids": [1, 2],
        "task_type": 0,
        "status": 0,
        "start_at": "2015-01-01T00:00:00.000+08:00",
        "end_at": "2015-01-01T23:59:00.000+08:00",
        "questionnaire_id": 12,
        "callout_note_template_id": 1,
        "hide_number": 1,
        "is_repeat_customer_task": 1,
        "distribution_basis": 1,
        "customers": [
            {"type":"token", "content":"123456", "callout_note_custom_fields": {"SelectField_1" : ["0", "0", "0", "0", "0", "0", "0"], "TextField_4" : "2019-11-13"}},
            {"type":"id","content":107387, "callout_note_custom_fields": {"TextField_5" : "11:04:35", "TextField_6" : "Outbound call business record", "SelectField_8" : ["0"]}},
            {"type":"email","content":"wxb1@qq.com"},
            {"type":"cellphone","content":"13500010846","batch_number":"myBatch123"}
        ]
    }
}'

Response

{
    "code": 1000,
    "callout_task": {
        "id": 1,
        "name": "CallOutTask",
        "status": 0,
        "description": "Test",
        "created_at": "2017-03-14T14:12:42.000+08:00",
        "customer_ids": [1, 2, 3, 4],
        "agent_ids": [1, 2],
        "start_at": "2015-01-01T00:00:00.000+08:00",
        "end_at": "2015-01-01T23:59:00.000+08:00",
        "task_type": 0,
        "agent_type": 0,
        "queue_ids": null,
        "customer_count": 4,
        "executed_count": 0,
        "success_count": 0,
        "total_executed_count": 0,
        "total_success_count": 0,
        "questionnaire_id": 12,
        "callout_note_template_id": 1,
        "hide_number": 1,
        "is_repeat_customer_task": 1,
        "distribution_basis": 1
    }
}

Update Callout Task

This interface is used to modify an existing callout task.

Request Method

PUT /callout_tasks/:id

Request Parameters (URL)

Parameter NameRequiredDescription
idYesCallout task ID

Request Parameters (Request Body)

Attribute NameTypeRequiredDescription
callout_taskObjectYesCallout task information, as follows
callout_task
Attribute NameTypeRequiredDescription
nameStringYesName
descriptionStringOptionalDescription
start_atDateTimeYesStart time
end_atDateTimeYesEnd time
statusIntegerYesStatus, 0 for enabled, 1 for paused
task_typeIntegerYesTask type, fixed to pass 0
agent_typeIntegerYes (New)Seat type, 0 for all customer service, 1 for queue, 2 for custom
distribution_strategyIntegerOptionalCustomer seat distribution strategy, 0 (default) for average distribution, 1 for load balancing distribution
queue_idsArrayOptionalArray of queue IDs
customersArrayOptionalArray of customer identifiers, which can be ID, token, phone, or email, used only for editing and creating
customer_idsArrayOptionalArray of customer IDs
distribution_basisIntegerOptionalBasis for distributing customers (0: Task customer ID, 1: Customer ID, default 0)

Response Data

The same as Get Callout Task Details.

Remarks

When creating or updating a manual callout task, to avoid issues when the start and end times are on the same day, the end time passed to the interface is adjusted by adding one day and subtracting one minute before being saved as the end time of the manual callout task. This means that the minimum duration of a manual callout task is 23 hours and 59 minutes.

Example

curl https://demo.udesk.cn/open_api_v1/callout_tasks/1?email=admin@udesk.cn&timestamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
 \
-X PUT \
-H 'content-type: application/json' \
-d '
{
    "callout_task": {
        "name": "CallOutTask",
        "description": "Demo",
        "agent_type": 0,
        "agent_ids": [1, 2],
        "task_type": 0,
        "status": 0,
        "distribution_basis": 0,
        "start_at": "2015-01-01T00:00:00.000+08:00",
        "end_at": "2015-01-01T23:59:00.000+08:00",
        "customers": [
            {"type":"token", "content":"123456"},
            {"type":"id","content":107387", "callout_note_custom_fields": {"TextField_5" : "11:04:35", "TextField_6" : "Outbound call business record", "SelectField_8" : ["0"], "SelectField_9" : "0,5,8"}},
            {"type":"email","content":"wxb1@qq.com"},
            {"type":"cellphone","content":"13500010846"}
        ]
    }
}'

Response

{
    "code": 1000,
    "callout_task": {
        "id": 1,
        "name": "CallOutTask",
        "status": 0,
        "description": "Demo",
        "created_at": "2017-03-14T14:12:42.000+08:00",
        "customer_ids": [1, 2, 3, 4],
        "agent_ids": [1, 2],
        "start_at": "2015-01-01T00:00:00.000+08:00",
        "end_at": "2015-01-01T23:59:00.000+08:00",
        "task_type": 0,
        "agent_type": 0,
        "queue_ids": null,
        "customer_count": 4,
        "executed_count": 0,
        "success_count": 0,
        "total_executed_count": 0,
        "total_success_count": 0,
        "questionnaire_id": 12,
        "callout_note_template_id": 1,
        "hide_number": 1,
        "is_repeat_customer_task": 1,
        "distribution_basis": 1
    }
}

Delete Callout Task

This interface is used to delete a callout task with a specified ID.

Request Method

DELETE /callout_tasks/:id

Request Parameters (URL)

Parameter NameRequiredDescription
idYesCallout task ID

Response Data

Attribute NameTypeDescription
codeIntegerExecution result code, 1000 represents success
idIntegerID of the deleted callout task

Example

curl https://demo.udesk.cn/open_api_v1/callout_tasks/1?email=admin@udesk.cn&timestamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
 \
-X DELETE

Response

{
    "code": 1000,
    "id": 1
}

Get Callout Task Customer List

This interface is used to obtain customer information for a specified callout task ID.

Request Method

GET /callout_tasks/customers

Request Parameters (Query String)

Parameter NameRequiredDescription
idYesCallout task ID
pageNoPagination page number, starting from 1, default to 1
per_pageNoNumber of items per page, default to 10, max to 100

Response Data

Attribute NameTypeDescription
codeIntegerExecution result code, 1000 represents success
metaObjectPagination information, see General Data
customersArray of ObjectsCustomer list

customers Element Data Structure

Attribute NameTypeDescription
task_idIntegerID of the sub-task within the callout task
idIntegerCustomer ID
nick_nameStringCustomer name
cellphonesArray of ObjectsCustomer mobile phone list
agent_idIntegerCustomer service ID
call_countIntegerNumber of calls
resultStringCall result

cellphones Element Structure

Attribute NameTypeDescription
idIntegerUnique identifier
contentStringPhone number

Example

curl https://demo.udesk.cn/open_api_v1/callout_tasks/customers?id=1&page=1&per_page=10&email=admin@udesk.cn&timestamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2

Response

{
    "code": 1000,
    "customers": [
        {
            "task_id": 1,
            "id": 1,
            "nick_name": "Test Customer",
            "cellphones": [
                {
                    "id": 1,
                    "content": "13000000001"
                }
            ],
            "agent_id": 1,
            "call_count": 0,
            "result": null
        }
    ],
    "meta": {
        "current_page": 1,
        "total_pages": 1,
        "total_count": 1
    }
}

Get Callout Task Customer Service List

This interface is used to obtain customer service information for a specified callout task ID.

Request Method

GET /callout_tasks/agents

Request Parameters (Query String)

Parameter NameRequiredDescription
idYesCallout task ID
pageNoPagination page number, starting from 1, default to 1
per_pageNoNumber of items per page, default to 10, max to 100

Response Data

Attribute NameTypeDescription
codeIntegerExecution result code, 1000 represents success
metaObjectPagination information, see General Data
agentsArray of ObjectsCustomer service list

agents Element Data Structure

Attribute NameTypeDescription
idIntegerCustomer service ID
nameStringCustomer service name
customer_countIntegerNumber of customers
executed_countIntegerNumber of executions
total_success_countIntegerNumber of successes
total_executed_countIntegerTotal number of executions

Example

curl https://demo.udesk.cn/open_api_v1/callout_tasks/agents?id=1&page=1&per_page=10&email=admin@udesk.cn&timestamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2

Response

{
    "code": 1000,
    "agents": [
        {
            "id": 1,
            "name": "Test Customer Service",
            "customer_count": 1,
            "executed_count": 0,
            "success_count": 0,
            "total_executed_count": 0,
            "total_success_count": 0
        }
    ],
    "meta": {
        "current_page": 1,
        "total_pages": 1,
        "total_count": 1
    }
}

Delete a Phone Number

This interface is used to delete a specified callout task number.

Request Method

DELETE /callout_tasks/:id/delete_number

Request Parameters

Parameter NameRequiredDescription
numberYesPhone number

Response Data

Attribute NameTypeDescription
codeIntegerExecution result code, 1000 represents success

Example

curl -X DELETE \
  https://demo.udesk.cn/open_api_v1/callout_tasks/1/delete_number?email=admin@udesk.cn&timestamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
 \
  -H 'content-type: application/json' \
  -d '{
  "number": "18710846413"
}'

Response Result

{
  "code": 1000
}

Redistribute a Phone Number

This interface is used to redistribute a phone number.

Request Method

POST /callout_tasks/:id/redistribution

Request Parameters

Parameter NameRequiredDescription
numberYesPhone number
agent_idYesCustomer service ID

Response Data

Attribute NameTypeDescription
codeIntegerExecution result code, 1000 represents success

Example

curl -X POST \
  https://demo.udesk.cn/open_api_v1/callout_tasks/1/redistribution?email=admin@udesk.cn&timestamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
 \
  -H 'content-type: application/json' \
  -d '{
  "number": "18710846413",
  "agent_id": 1
}'

Response Result

{
  "code": 1000
}

Data Structure - Callout Task

Attribute NameTypeEditableRequiredDescription
idIntegerNoYesUnique identifier
nameStringYesYesName
descriptionStringYesNoDescription
start_atDateTimeYesYesStart time
end_atDateTimeYesYesEnd time
created_atDateTimeNoNoCreation time
statusIntegerYesYesStatus, 0 for enabled, 1 for paused
task_typeIntegerYesYesTask type, fixed to pass 0
agent_typeIntegerYes (New)YesSeat type, 0 for all customer service, 1 for queue, 2 for custom
distribution_strategyIntegerYesNoCustomer seat distribution strategy, 0 (default) for average distribution, 1 for load balancing distribution
queue_idsArrayYes (New)NoArray of queue IDs
customersArrayYesNoArray of customer identifiers, which can be ID, token, phone, or email, used only for editing and creating
customer_idsArrayNoYesArray of customer IDs
agent_idsArrayYes (New)NoArray of customer service IDs
customer_countIntegerNoNoNumber of customers
executed_countIntegerNoNoNumber of connections
success_countIntegerNoNoNumber of successful connections
total_executed_countIntegerNoNoTotal number of executions
total_success_countIntegerNoNoTotal number of successful connections
questionnaire_idIntegerYes (New)NoID of the survey questionnaire template bound to the callout task
callout_note_template_idIntegerYes (New)NoID of the callout business information template associated with the callout task

customers Element Structure

Attribute NameTypeDescription
typeStringType of search condition, can be "id", "token", "email", or "cellphone"
contentStringContent of the search condition

Get Callout Business Information Template List

This interface is used to obtain a list of callout business information templates.

Request Method

GET /callout_note_templates

Request Parameters

None

Response Data

Attribute NameTypeDescription
codeIntegerExecution result code, 1000 represents success
callout_note_templatesArray of ObjectsCallout business information template list information, including template ID and template name

Example

curl https://demo.udesk.cn/open_api_v1/callout_note_templates?email=admin@udesk.cn&timestamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2

Response

{
  "code": 1000,
  "callout_note_templates": [{
      "id": 4,
      "name": "Test new callout business information template"
    },
    {
      "id": 55,
      "name": "Callout task"
    }
  ]
}

Get Callout Business Information Template Details

This interface is used to obtain information for a specified callout business information template ID.

Request Method

GET /callout_note_templates/:id

Request Parameters (URL)

Parameter NameRequiredDescription
idYesCallout business information template ID

Response Data

Attribute NameTypeDescription
codeIntegerExecution result code, 1000 represents success
callout_note_templateObjectCallout business information template information, refer to the following data structure

Data Structure - Callout Business Information Template

Attribute NameTypeDescription
idIntegerUnique identifier
nameStringName
descStringDescription
fieldsArray of ObjectsCustom fields, refer to udesk Custom Fields

Example

curl https://demo.udesk.cn/open_api_v1/callout_note_templates/1?email=admin@udesk.cn&timestamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2

Response

{
  "code": 1000,
  "callout_note_template": {
    "id": 4,
    "name": "Test new callout business information template",
    "desc": "This is a new test, add, delete, modify, and query",
    "fields": [{
        "field_name": "TextField_20",
        "field_label": "Description",
        "content_type": "text",
        "comment": null,
        "options": null
      },
      {
        "field_name": "TextField_21",
        "field_label": "Extended content",
        "content_type": "text",
        "comment": null,
        "options": null
      },
      {
        "field_name": "TextField_23",
        "field_label": "DateTime",
        "content_type": "date",
        "comment": "DateTime",
        "options": null
      }
    ]
  }
}

Code Error Codes Explanation

Error CodeMessage InformationException:Message InformationDescription
2000Unknown errorRequired parameter {start_at} not filled inRequired parameter {start_at} not filled in
Required parameter {end_at} not filled inRequired parameter {end_at} not filled in
Required parameter {agent_ids} not filled inRequired parameter {agent_ids} not filled in
Invalid customer service typeThe value of parameter {agent_type} is not within the allowable range
Illegal customer service IDParameter {agent_ids} format error
Unable to parse customer IDParameter {customer_ids} format error
Invalid status typeThe value of parameter {status} is not within the allowable range
Name is requiredRequired parameter {name} not filled in
Invalid task typeThe value of parameter {task_type} is not 0
Queue ID is requiredRequired parameter {queue_ids} not filled in
Illegal queueParameter {queue_ids} format error
Start time/end time format is incorrectParameter {start_at} or {end_at} format error
Start time must be less than end timeThe value of parameter {start_at} is greater than {end_at}
Survey questionnaire template does not existRequired parameter {questionnaire_id} not filled in
Survey questionnaire template is closed and cannot be usedThe status of the survey questionnaire template corresponding to parameter {questionnaire_id} is closed
Callout business information template does not existRequired parameter {callout_note_template_id} not filled in
Missing or empty parameter: callout_taskRequired parameter {callout_task} not filled in or is empty
2005Resource not foundCouldn't find CalloutTask without an IDIncorrect parameter {id} value, no match found
20282Template has been deletedNo match found for parameter {id}
50048Customer not found in taskThe customer corresponding to parameter {agent_id} is not in this callout task
50049Required or illegal customer service IDRequired parameter {agent_id} not filled in or format error
501032Illegal numberParameter {number} format error, this parameter type is a string