logo

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 NameRequiredDescription
pageNoPage number, starts from 1, default is 1
per_pageNoNumber per page, default is 10, maximum is 100

Response Parameters

Attribute NameTypeDescription
codeIntegerExecution result code, 1000 represents success
metaObjectPagination information, see General Data
questionnairesArraySurvey 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&timestamp=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 NameRequiredDescription
task_typeYesTask type (Manual outbound call: "callout_task"; Automatic outbound call: "ad_task")
task_idYesID of the manual outbound call or automatic outbound call task
pageNoPage number, starts from 1, default is 1
per_pageNoNumber per page, default is 10, maximum is 100

Response Parameters

Attribute NameTypeDescription
codeIntegerExecution result code, 1000 represents success
metaObjectPagination information, see General Data
customer_questionnairesArrayList 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&timestamp=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 NameRequiredDescription
questionnaire_idYesSurvey questionnaire template ID
pageNoPage number, starts from 1, default is 1
per_pageNoNumber per page, default is 10, maximum is 100

Response Parameters

Attribute NameTypeDescription
codeIntegerExecution result code, 1000 represents success
metaObjectPagination information, see General Data
customer_questionnairesArrayList 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&timestamp=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 NameTypeDescription
customer_idIntegerSurvey customer ID
agent_idIntegerSurvey customer service ID
created_atDateTimeSurvey time
agent_nameStringSurvey customer service name
customer_nameStringSurvey customer name
contentsHashSurvey 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 NameTypeDescription
idIntegerSurvey questionnaire template ID
nameStringSurvey questionnaire template name
statusBooleanSurvey questionnaire template activation status
created_atDateTimeSurvey questionnaire template creation time

Error Code Explanation

Error CodeMessageException MessageDescription
2005Resource not foundCouldn't find Questionnaire without an IDParameter id error, no data found
13000Non-existent survey questionnaireNoneRequired parameter not added
13003Outbound call task does not existNoneParameter task_id or task_type error