Retrieve Survey Questionnaire List
This interface is used to obtain the list of global survey questionnaire templates for a company.
Request Method
GET /questionnaires/questionnaire_list
Request Parameters
Parameter Name | Required | Description |
---|
page | No | Page number, starts from 1, default is 1 |
per_page | No | Number per page, default is 10, maximum is 100 |
Response Parameters
Attribute Name | Type | Description |
---|
code | Integer | Execution result code, 1000 represents success |
meta | Object | Pagination information, see General Data |
questionnaires | Array | Survey questionnaire template list Survey Questionnaire Template |
Example Request
curl https://demo.udesk.cn/open_api_v1/questionnaires/questionnaire_list?page=2&email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
Example Response
{
"code": 1000,
"questionnaires": [{
"id": 1,
"name": "Test",
"status": true,
"created_at": "2019-01-14T16:01:28.000+08:00"
}],
"meta": {
"current_page": 2,
"total_pages": 2,
"total_records": 11
}
}
Retrieve Outbound Call Task Survey Questionnaire Data Interface
This interface is used to obtain the list of survey questionnaires filled in for outbound call tasks.
Request Method
GET /questionnaires/task_questionnaires
Request Parameters
Parameter Name | Required | Description |
---|
task_type | Yes | Task type (Manual outbound call: "callout_task"; Automatic outbound call: "ad_task") |
task_id | Yes | ID of the manual outbound call or automatic outbound call task |
page | No | Page number, starts from 1, default is 1 |
per_page | No | Number per page, default is 10, maximum is 100 |
Response Parameters
Attribute Name | Type | Description |
---|
code | Integer | Execution result code, 1000 represents success |
meta | Object | Pagination information, see General Data |
customer_questionnaires | Array | List of survey questionnaire submissions Survey Questionnaire Submission Data |
Example Request
curl https://demo.udesk.cn/open_api_v1/questionnaires/task_questionnaires?task_type=callout_task&task_id=210&email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c68c67-87feb05e1594&sign_version=v2
Example Response
{
"code": 1000,
"customer_questionnaires": [
{
"customer_id": 3933,
"agent_id": 757,
"created_at": "2022-03-14T20:17:18.000+08:00",
"agent_name": "Testerkun",
"customer_name": "S1qilin",
"questionnaire_name": "Tester's Questionnaire",
"customer_questionnair_id": 639,
"questionnaire_id": 17,
"contents": {
"What are you doing": "XXX",
"Who do you like": "XXX",
"Test test sai": "XXX"
}
}
],
"meta": {
"current_page": 1,
"total_pages": 1,
"total_records": 1
}
}
Retrieve Survey Questionnaire Data Interface
This interface is used to obtain the list of survey questionnaire submission data corresponding to the survey questionnaire template.
Request Method
GET /questionnaires/customer_questionnaires
Request Parameters
Parameter Name | Required | Description |
---|
questionnaire_id | Yes | Survey questionnaire template ID |
page | No | Page number, starts from 1, default is 1 |
per_page | No | Number per page, default is 10, maximum is 100 |
Response Parameters
Attribute Name | Type | Description |
---|
code | Integer | Execution result code, 1000 represents success |
meta | Object | Pagination information, see General Data |
customer_questionnaires | Array | List of survey questionnaire submission data Survey Questionnaire Submission Data |
Example Request
curl http://linapp.udeskcat.com/open_api_v1/questionnaires/customer_questionnaires?questionnaire_id=11&email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
Example Response
{
"code": 1000,
"customer_questionnaires": [
{
"customer_id": 196329,
"agent_id": 365,
"created_at": "2019-06-26T19:59:07.000+08:00",
"agent_name": "bai",
"customer_name": null,
"contents": {
"Question 2": null,
"Question 3": "1;2;4",
"Question 1": "2"
}
},
{
"customer_id": 196329,
"agent_id": 365,
"created_at": "2019-06-24T18:25:58.000+08:00",
"agent_name": "bai",
"customer_name": null,
"contents": {
"Question 2": "Question 2 Question2 Question 2 Question 2 Question 2 Question 2 Question 2 Question 2 Question 2 Question 2 Question 2",
"Question 3": "1;2;4",
"Question 1": null,
}
}
],
"meta": {
"current_page": 1,
"total_pages": 1,
"total_records": 2
}
}
Survey Questionnaire Submission Data
Attribute Name | Type | Description |
---|
customer_id | Integer | Survey customer ID |
agent_id | Integer | Survey customer service ID |
created_at | DateTime | Survey time |
agent_name | String | Survey customer service name |
customer_name | String | Survey customer name |
contents | Hash | Survey results {"Question": "Answer"}, answers that are not provided or have been deleted are null. The value is a string or null |
Survey Questionnaire Template
Attribute Name | Type | Description |
---|
id | Integer | Survey questionnaire template ID |
name | String | Survey questionnaire template name |
status | Boolean | Survey questionnaire template activation status |
created_at | DateTime | Survey questionnaire template creation time |
Error Code Explanation
Error Code | Message | Exception Message | Description |
---|
2005 | Resource not found | Couldn't find Questionnaire without an ID | Parameter id error, no data found |
13000 | Non-existent survey questionnaire | None | Required parameter not added |
13003 | Outbound call task does not exist | None | Parameter task_id or task_type error |