# QuestionPro

> Read QuestionPro survey responses and results, record new responses, and email surveys to your lists.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/questionpro

## Actions

### Add email addresses

Add people to an email list, with names and custom values.

**Inputs**

- Survey (`survey_id`, number, required): The survey. Use a survey ID from List surveys or Get survey.
- Email list (`email_list_id`, number, required): The email list.
- People (`contacts`, list, required): The people to add, each with an emailAddress and, if you like, firstname, lastname and custom1 to custom5.

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {
    "requestID": "7012fedc-e8ce-48ae-b800-6q5ce287987a7dje",
    "response": {
      "message": "Email address upload process has started successfully.",
      "statusUrl": "https://api.questionpro.com/a/api/v2/surveys/1/emaillists/2/emails/3/status"
    }
  }
}
```

### Create email list

Create an email list, for one survey or for all.

**Inputs**

- Survey (`survey_id`, number, required): The survey. Use a survey ID from List surveys or Get survey.
- Name (`name`, text, required): The list's name.
- Used by (`group_type`, text, required): Whether every survey or only this one can use the list. One of: `Global` (All surveys), `Survey` (This survey).

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {
    "requestID": "7012fedc-e8ce-48ae-b800-6q5ce287987a7dje",
    "response": {
      "emailListID": 1234567,
      "emailListStatistics": {
        "activeCount": 100,
        "bounceCount": 0,
        "pendingVerificationCount": 0,
        "totalCount": 100,
        "unsubscribeCount": 0
      },
      "groupType": "Global",
      "name": "API Email List",
      "spamIndex": "Good",
      "surveyID": 0,
      "userID": 9876543
    }
  }
}
```

### Create response

Add a response to a survey, for example one collected offline.

**Inputs**

- Survey (`survey_id`, number, required): The survey. Use a survey ID from List surveys or Get survey.
- Answers (`response_set`, list, required): The answers, one per question, each with a questionID and its answerValues.
- Status (`response_status`, text): The response's status, such as Completed.
- External reference (`external_reference`, text): Your own reference for the response.
- Language ID (`language_id`, number): QuestionPro's ID of the response's language; English (250) if left empty.
- IP address (`ip_address`, text): The IP address it came from.
- Seconds taken (`time_taken`, number): How many seconds it took.
- Custom variables (`custom_variables`, object): Values for custom1 to custom5.

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {
    "requestID": "7012fedc-e8ce-48ae-b800-6q5ce287987a7dje",
    "response": {
      "browser": "CHROME8",
      "currentInset": "",
      "customVariables": {
        "custom1": "WA"
      },
      "dataQuality": "unflagged",
      "dataQualityScore": 0.0,
      "duplicate": false,
      "externalReference": "",
      "ipAddress": "192.168.0.1",
      "language": "English",
      "location": {
        "country": "India",
        "countryCode": "IN",
        "latitude": 0.0,
        "longitude": 0.0,
        "radius": 0.0,
        "region": "16"
      },
      "operatingSystem": "WINDOWS_10",
      "osDeviceType": "COMPUTER",
      "responseID": 12345678,
      "responseSet": [
        {
          "answerValues": [
            {
              "answerID": 123456789,
              "answerText": "Always",
              "value": {
                "dynamicExplodeText": "",
                "fileLink": "",
                "other": "",
                "result": "",
                "scale": "1",
                "text": "FirstName",
                "weight": 0.0
              }
            }
          ],
          "questionCode": "Q1",
          "questionDescription": " ",
          "questionID": 12345678,
          "questionText": "How often do you conduct surveys?"
        }
      ],
      "responseStatus": "Completed",
      "surveyID": 7654321,
      "surveyName": "Test Survey",
      "timeTaken": 41,
      "timestamp": "05 Oct, 2020 02:51:51 PM PDT"
    }
  }
}
```

### Create survey

Create an empty survey for a user.

**Inputs**

- User ID (`owner_id`, number, required): Your QuestionPro user ID. Get survey shows it as the survey's ownerID.
- Name (`name`, text, required): The survey's name.
- Folder (`folder_id`, number): The folder to keep it in.
- Response quota (`response_quota`, text): Close the survey after this many responses.
- Save and continue (`save_and_continue`, true/false): Let people save their answers and finish later.
- Closed message (`inactive_text`, text): The text shown once the survey is closed.
- Closes on (`expiry_date`, date): The day the survey closes.

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {
    "requestID": "7012fedc-e8ce-48ae-b800-6q5ce287987a7dje",
    "response": {
      "abbs": false,
      "completedResponses": 10,
      "completedText": "Thank you for completing this survey.",
      "creationDate": "17 Nov, 2020 12:00:00 AM PST",
      "expiryDate": "12/31/2023",
      "folderID": 7654321,
      "hasScoringLogic": false,
      "inactiveText": "This Survey has been deactivated by the owner.",
      "modifiedDate": "17 Nov, 2020 03:19:07 AM PST",
      "name": "Product Satisfaction",
      "ownerID": 9587462,
      "quotaOverlimitText": "Thank you for your time but we have already received the required responses.",
      "responseQuota": 0,
      "saveAndContinue": false,
      "status": "Active",
      "surveyFinishMode": 15,
      "surveyID": 1234567,
      "surveyLanguages": [
        {
          "default": true,
          "name": "English"
        }
      ],
      "terminatedText": "Your profile does not fit our criteria. Thank you for your time",
      "thankYouMessage": "Thank you for completing this survey.",
      "url": "https://www.questionpro.com/t/XXXXXXXXXX"
    }
  }
}
```

### Delete email list

Delete an email list.

**Inputs**

- Survey (`survey_id`, number, required): The survey. Use a survey ID from List surveys or Get survey.
- Email list (`email_list_id`, number, required): The email list.

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {}
}
```

### Delete response

Delete a response from a survey.

**Inputs**

- Survey (`survey_id`, number, required): The survey. Use a survey ID from List surveys or Get survey.
- Response ID (`response_id`, number, required): The response's ID.

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {}
}
```

### Delete survey

Delete a survey and its responses.

**Inputs**

- User ID (`owner_id`, number, required): Your QuestionPro user ID. Get survey shows it as the survey's ownerID.
- Survey (`survey_id`, number, required): The survey's ID.

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {}
}
```

### Get question

Get a question and its answer choices.

**Inputs**

- Survey (`survey_id`, number, required): The survey. Use a survey ID from List surveys or Get survey.
- Question ID (`question_id`, number, required): The question's ID.

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {
    "requestID": "7012fedc-e8ce-48ae-b800-6q5ce287987a7dje",
    "response": {
      "answers": [
        {
          "answerID": 462043572,
          "excludeRandomization": false,
          "text": "Male"
        }
      ],
      "blockID": 123456,
      "code": "Q1",
      "orderNumber": 1,
      "questionID": 86055471,
      "required": true,
      "text": "Please select your gender",
      "type": "multiplechoice_radio"
    }
  }
}
```

### Get response

Get one response with every answer.

**Inputs**

- Survey (`survey_id`, number, required): The survey. Use a survey ID from List surveys or Get survey.
- Response ID (`response_id`, number, required): The response's ID.

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {
    "requestID": "7012fedc-e8ce-48ae-b800-6q5ce287987a7dje",
    "response": {
      "browser": "CHROME8",
      "currentInset": "",
      "customVariables": {
        "custom1": "WA"
      },
      "dataQuality": "unflagged",
      "dataQualityScore": 0.0,
      "duplicate": false,
      "externalReference": "",
      "ipAddress": "192.168.0.1",
      "language": "English",
      "location": {
        "country": "India",
        "countryCode": "IN",
        "latitude": 0.0,
        "longitude": 0.0,
        "radius": 0.0,
        "region": "16"
      },
      "operatingSystem": "WINDOWS_10",
      "osDeviceType": "COMPUTER",
      "responseID": 12345678,
      "responseSet": [
        {
          "answerValues": [
            {
              "answerID": 123456789,
              "answerText": "Always",
              "value": {
                "dynamicExplodeText": "",
                "fileLink": "",
                "other": "",
                "result": "",
                "scale": "1",
                "text": "FirstName",
                "weight": 0.0
              }
            }
          ],
          "questionCode": "Q1",
          "questionDescription": " ",
          "questionID": 12345678,
          "questionText": "How often do you conduct surveys?"
        }
      ],
      "responseStatus": "Completed",
      "surveyID": 7654321,
      "surveyName": "Test Survey",
      "timeTaken": 41,
      "timestamp": "05 Oct, 2020 02:51:51 PM PDT",
      "utctimestamp": 51
    }
  }
}
```

### Get send recipients

List who an email send went to and whether each started or finished the survey.

**Inputs**

- Survey (`survey_id`, number, required): The survey. Use a survey ID from List surveys or Get survey.
- Send ID (`batch_id`, number, required): The email send, from List email sends.
- Page (`page`, number): Which page to return, starting at 1. At least 1.
- Page size (`per_page`, number): How many to return on one page, up to 1,000; 100 if left empty. From 1 to 1000.

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {
    "pagination": {
      "currentPage": 1,
      "links": {
        "first": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100",
        "last": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100",
        "next": "",
        "prev": "",
        "self": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100"
      },
      "perPage": 100,
      "totalItems": 30,
      "totalPages": 1
    },
    "requestID": "7012fedc-e8ce-48ae-b800-6q5ce287987a7dje",
    "response": [
      {
        "custom1": "uio",
        "custom2": "rty",
        "custom3": "qwe",
        "custom4": "xyz",
        "custom5": "abc",
        "emailAddress": "jane@example.com",
        "responseID": 32438884,
        "status": "Started"
      }
    ]
  }
}
```

### Get survey

Get a survey's settings and response counts.

**Inputs**

- Survey ID (`survey_id`, number, required): The survey's ID, the number in its address in QuestionPro.

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {
    "requestID": "7012fedc-e8ce-48ae-b800-6q5ce287987a7dje",
    "response": {
      "abbs": false,
      "completedResponses": 10,
      "completedText": "Thank you for completing this survey.",
      "creationDate": "17 Nov, 2020 12:00:00 AM PST",
      "expiryDate": "12/31/2023",
      "folderID": 7654321,
      "hasScoringLogic": false,
      "inactiveText": "This Survey has been deactivated by the owner.",
      "lastResponseReceived": "2021-03-02 02:37:31.0",
      "modifiedDate": "17 Nov, 2020 03:19:07 AM PST",
      "name": "Product Satisfaction",
      "ownerID": 9587462,
      "quotaOverlimitText": "Thank you for your time but we have already received the required responses.",
      "responseQuota": 0,
      "saveAndContinue": false,
      "startedResponses": 30,
      "status": "Active",
      "surveyFinishMode": 15,
      "surveyID": 1234567,
      "surveyLanguages": [
        {
          "default": true,
          "name": "English"
        }
      ],
      "terminatedResponses": 3,
      "terminatedText": "Your profile does not fit our criteria. Thank you for your time",
      "thankYouMessage": "Thank you for completing this survey.",
      "url": "https://www.questionpro.com/t/XXXXXXXXXX",
      "viewedResponses": 41
    }
  }
}
```

### Get survey results

Get each question's answer counts and percentages.

**Inputs**

- Survey (`survey_id`, number, required): The survey. Use a survey ID from List surveys or Get survey.

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {
    "requestID": "7012fedc-e8ce-48ae-b800-6q5ce287987a7dje",
    "response": {
      "sections": [
        {
          "questions": [
            {
              "answers": [
                {
                  "count": 3.0,
                  "percentage": 60.0,
                  "title": "Yes"
                }
              ],
              "averageScore": 0.0,
              "code": "Q1",
              "highChartJSON": "{}",
              "id": 123610961,
              "percentageTotal": 100.0,
              "required": false,
              "totalCount": 5.0,
              "type": "multiplechoice_radio"
            }
          ],
          "title": "Do you like streaming on US based OTT platforms in English language?"
        }
      ]
    }
  }
}
```

### List email addresses

List the people on an email list.

**Inputs**

- Survey (`survey_id`, number, required): The survey. Use a survey ID from List surveys or Get survey.
- Email list (`email_list_id`, number, required): The email list.
- Page (`page`, number): Which page to return, starting at 1. At least 1.
- Page size (`per_page`, number): How many to return on one page, up to 1,000; 100 if left empty. From 1 to 1000.

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {
    "pagination": {
      "currentPage": 1,
      "links": {
        "first": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100",
        "last": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100",
        "next": "",
        "prev": "",
        "self": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100"
      },
      "perPage": 100,
      "totalItems": 30,
      "totalPages": 1
    },
    "requestID": "7012fedc-e8ce-48ae-b800-6q5ce287987a7dje",
    "response": [
      {
        "address1": "",
        "address2": "",
        "addressID": 100000012,
        "city": "",
        "creationDate": "Thu 31 Oct, 17:24:36 GMT 2019",
        "custom1": "Employee 7",
        "custom2": "Security",
        "custom3": "Product R",
        "custom4": "",
        "custom5": "",
        "emailAddress": "jane@example.com",
        "emailListID": 1234567,
        "firstname": "Jane",
        "highCustomVariables": {
          "custom8": "Product A"
        },
        "lastname": "Doe",
        "phone": "",
        "state": "",
        "zipcode": ""
      }
    ]
  }
}
```

### List email lists

List the email lists a survey can be sent to.

**Inputs**

- Survey (`survey_id`, number, required): The survey. Use a survey ID from List surveys or Get survey.
- Page (`page`, number): Which page to return, starting at 1. At least 1.
- Page size (`per_page`, number): How many to return on one page, up to 1,000; 100 if left empty. From 1 to 1000.

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {
    "pagination": {
      "currentPage": 1,
      "links": {
        "first": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100",
        "last": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100",
        "next": "",
        "prev": "",
        "self": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100"
      },
      "perPage": 100,
      "totalItems": 30,
      "totalPages": 1
    },
    "requestID": "7012fedc-e8ce-48ae-b800-6q5ce287987a7dje",
    "response": [
      {
        "emailListID": 1234567,
        "emailListStatistics": {
          "activeCount": 100,
          "bounceCount": 0,
          "pendingVerificationCount": 0,
          "totalCount": 100,
          "unsubscribeCount": 0
        },
        "groupType": "Global",
        "name": "API Email List",
        "spamIndex": "Good",
        "surveyID": 0,
        "userID": 9876543
      }
    ]
  }
}
```

### List email sends

List the times a survey was emailed, with delivery and response counts.

**Inputs**

- Survey (`survey_id`, number, required): The survey. Use a survey ID from List surveys or Get survey.
- Page (`page`, number): Which page to return, starting at 1. At least 1.
- Page size (`per_page`, number): How many to return on one page, up to 1,000; 100 if left empty. From 1 to 1000.

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {
    "pagination": {
      "currentPage": 1,
      "links": {
        "first": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100",
        "last": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100",
        "next": "",
        "prev": "",
        "self": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100"
      },
      "perPage": 100,
      "totalItems": 30,
      "totalPages": 1
    },
    "requestID": "7012fedc-e8ce-48ae-b800-6q5ce287987a7dje",
    "response": [
      {
        "batchType": 1,
        "creationDate": "2020-11-05T07:14:29.000+00:00",
        "description": "Email List : Default List-0",
        "emailBatchID": 1234567,
        "emailBatchStatistics": {
          "blockedCount": 0,
          "errorCount": 0,
          "participationPendingCount": 1,
          "queuedCount": 0,
          "sentCount": 1,
          "startedCount": 0,
          "takenCount": 0,
          "unSubscribedCount": 0,
          "viewedCount": 0
        },
        "emailCount": 1,
        "emailFrom": "surveys@example.com",
        "emailFromName": "Survey Administrator",
        "emailText": "Hello, please click on this link to complete the survey: <SURVEY_LINK>",
        "status": 2,
        "subject": "Survey Invitation",
        "surveyID": 7654321,
        "userID": 9876543
      }
    ]
  }
}
```

### List email templates

List the invitation templates a survey can be sent with.

**Inputs**

- Survey (`survey_id`, number, required): The survey. Use a survey ID from List surveys or Get survey.
- Page (`page`, number): Which page to return, starting at 1. At least 1.
- Page size (`per_page`, number): How many to return on one page, up to 1,000; 100 if left empty. From 1 to 1000.

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {
    "pagination": {
      "currentPage": 1,
      "links": {
        "first": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100",
        "last": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100",
        "next": "",
        "prev": "",
        "self": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100"
      },
      "perPage": 100,
      "totalItems": 30,
      "totalPages": 1
    },
    "requestID": "7012fedc-e8ce-48ae-b800-6q5ce287987a7dje",
    "response": [
      {
        "content": "Please complete the survey: <SURVEY_LINK>",
        "draft": false,
        "emailSubject": "Survey Invitation",
        "emailTemplateID": 123456,
        "isGlobal": false,
        "surveyID": 9876543,
        "title": "API Template",
        "type": 2,
        "userID": 1234567
      }
    ]
  }
}
```

### List folders

List a user's survey folders.

**Inputs**

- User ID (`owner_id`, number, required): Your QuestionPro user ID. Get survey shows it as the survey's ownerID.
- Page (`page`, number): Which page to return, starting at 1. At least 1.
- Page size (`per_page`, number): How many to return on one page, up to 1,000; 100 if left empty. From 1 to 1000.

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {
    "pagination": {
      "currentPage": 1,
      "links": {
        "first": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100",
        "last": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100",
        "next": "",
        "prev": "",
        "self": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100"
      },
      "perPage": 100,
      "totalItems": 30,
      "totalPages": 1
    },
    "requestID": "7012fedc-e8ce-48ae-b800-6q5ce287987a7dje",
    "response": [
      {
        "creationDate": "2020-03-31",
        "folderID": 9876545,
        "folderName": "Feedback Surveys",
        "isDefault": false,
        "surveyCount": 10,
        "userID": 1234567
      }
    ]
  }
}
```

### List questions

List a survey's questions and their answer choices.

**Inputs**

- Survey (`survey_id`, number, required): The survey. Use a survey ID from List surveys or Get survey.
- Page (`page`, number): Which page to return, starting at 1. At least 1.
- Page size (`per_page`, number): How many to return on one page, up to 1,000; 100 if left empty. From 1 to 1000.
- Language ID (`language_id`, number): QuestionPro's ID of the language to read them in; English (250) if left empty.

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {
    "pagination": {
      "currentPage": 1,
      "links": {
        "first": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100",
        "last": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100",
        "next": "",
        "prev": "",
        "self": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100"
      },
      "perPage": 100,
      "totalItems": 30,
      "totalPages": 1
    },
    "requestID": "7012fedc-e8ce-48ae-b800-6q5ce287987a7dje",
    "response": [
      {
        "answers": [
          {
            "answerID": 462043572,
            "excludeRandomization": false,
            "text": "Male"
          }
        ],
        "blockID": 123456,
        "code": "Q1",
        "orderNumber": 1,
        "questionID": 86055471,
        "required": true,
        "text": "Please select your gender",
        "type": "multiplechoice_radio"
      }
    ]
  }
}
```

### List responses

List a survey's responses with every answer.

**Inputs**

- Survey (`survey_id`, number, required): The survey. Use a survey ID from List surveys or Get survey.
- Page (`page`, number): Which page to return, starting at 1. At least 1.
- Page size (`per_page`, number): How many to return on one page, up to 1,000; 100 if left empty. From 1 to 1000.

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {
    "pagination": {
      "currentPage": 1,
      "links": {
        "first": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100",
        "last": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100",
        "next": "",
        "prev": "",
        "self": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100"
      },
      "perPage": 100,
      "totalItems": 30,
      "totalPages": 1
    },
    "requestID": "7012fedc-e8ce-48ae-b800-6q5ce287987a7dje",
    "response": [
      {
        "browser": "CHROME8",
        "currentInset": "",
        "customVariables": {
          "custom1": "WA"
        },
        "dataQuality": "unflagged",
        "dataQualityScore": 0.0,
        "duplicate": false,
        "externalReference": "",
        "ipAddress": "192.168.0.1",
        "language": "English",
        "location": {
          "country": "India",
          "countryCode": "IN",
          "latitude": 0.0,
          "longitude": 0.0,
          "radius": 0.0,
          "region": "16"
        },
        "operatingSystem": "WINDOWS_10",
        "osDeviceType": "COMPUTER",
        "responseID": 12345678,
        "responseSet": [
          {
            "answerValues": [
              {
                "answerID": 123456789,
                "answerText": "Always",
                "value": {
                  "dynamicExplodeText": "",
                  "fileLink": "",
                  "other": "",
                  "result": "",
                  "scale": "1",
                  "text": "FirstName",
                  "weight": 0.0
                }
              }
            ],
            "questionCode": "Q1",
            "questionDescription": " ",
            "questionID": 12345678,
            "questionText": "How often do you conduct surveys?"
          }
        ],
        "responseStatus": "Completed",
        "surveyID": 7654321,
        "surveyName": "Test Survey",
        "timeTaken": 41,
        "timestamp": "05 Oct, 2020 02:51:51 PM PDT"
      }
    ]
  }
}
```

### List surveys

List a user's surveys with their response counts.

**Inputs**

- User ID (`owner_id`, number, required): Your QuestionPro user ID. Get survey shows it as the survey's ownerID.
- Page (`page`, number): Which page to return, starting at 1. At least 1.
- Page size (`per_page`, number): How many to return on one page, up to 1,000; 100 if left empty. From 1 to 1000.

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {
    "pagination": {
      "currentPage": 1,
      "links": {
        "first": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100",
        "last": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100",
        "next": "",
        "prev": "",
        "self": "https://api.questionpro.com/a/api/v2/users/9587462/surveys?page=1&perPage=100"
      },
      "perPage": 100,
      "totalItems": 30,
      "totalPages": 1
    },
    "requestID": "7012fedc-e8ce-48ae-b800-6q5ce287987a7dje",
    "response": [
      {
        "abbs": false,
        "completedResponses": 10,
        "completedText": "Thank you for completing this survey.",
        "creationDate": "17 Nov, 2020 12:00:00 AM PST",
        "expiryDate": "12/31/2023",
        "folderID": 7654321,
        "hasScoringLogic": false,
        "inactiveText": "This Survey has been deactivated by the owner.",
        "lastResponseReceived": "2021-03-02 02:37:31.0",
        "modifiedDate": "17 Nov, 2020 03:19:07 AM PST",
        "name": "Product Satisfaction",
        "ownerID": 9587462,
        "quotaOverlimitText": "Thank you for your time but we have already received the required responses.",
        "responseQuota": 0,
        "saveAndContinue": false,
        "startedResponses": 30,
        "status": "Active",
        "surveyFinishMode": 15,
        "surveyID": 1234567,
        "surveyLanguages": [
          {
            "default": true,
            "name": "English"
          }
        ],
        "terminatedResponses": 3,
        "terminatedText": "Your profile does not fit our criteria. Thank you for your time",
        "thankYouMessage": "Thank you for completing this survey.",
        "url": "https://www.questionpro.com/t/XXXXXXXXXX",
        "viewedResponses": 41
      }
    ]
  }
}
```

### Send reminder

Remind the people on an email list who haven't answered a send, using one of your templates.

**Inputs**

- Survey (`survey_id`, number, required): The survey. Use a survey ID from List surveys or Get survey.
- Send ID (`batch_id`, number, required): The email send to follow up, from List email sends.
- Email list (`email_list_id`, number, required): The email list to send to.
- Template (`template_id`, number, required): The email template to send.

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {
    "requestID": "7012fedc-e8ce-48ae-b800-6q5ce287987a7dje",
    "response": {
      "batchType": 1,
      "creationDate": "2020-11-05T07:14:29.000+00:00",
      "description": "Email List : Default List-0",
      "emailBatchID": 1234567,
      "emailBatchStatistics": {
        "blockedCount": 0,
        "errorCount": 0,
        "participationPendingCount": 1,
        "queuedCount": 0,
        "sentCount": 1,
        "startedCount": 0,
        "takenCount": 0,
        "unSubscribedCount": 0,
        "viewedCount": 0
      },
      "emailCount": 1,
      "emailFrom": "surveys@example.com",
      "emailFromName": "Survey Administrator",
      "emailText": "Hello, please click on this link to complete the survey: <SURVEY_LINK>",
      "status": 2,
      "subject": "Survey Invitation",
      "surveyID": 7654321,
      "userID": 9876543
    }
  }
}
```

### Send survey to email addresses

Email a survey to the addresses you list, using one of your templates.

**Inputs**

- Survey (`survey_id`, number, required): The survey. Use a survey ID from List surveys or Get survey.
- Email addresses (`emails`, list, required): The addresses to send to. After each address you can add commas and up to five custom values.
- Template (`template_id`, number, required): The email template to send.

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {
    "requestID": "7012fedc-e8ce-48ae-b800-6q5ce287987a7dje",
    "response": {
      "batchType": 1,
      "creationDate": "2020-11-05T07:14:29.000+00:00",
      "description": "Email List : Default List-0",
      "emailBatchID": 1234567,
      "emailBatchStatistics": {
        "blockedCount": 0,
        "errorCount": 0,
        "participationPendingCount": 1,
        "queuedCount": 0,
        "sentCount": 1,
        "startedCount": 0,
        "takenCount": 0,
        "unSubscribedCount": 0,
        "viewedCount": 0
      },
      "emailCount": 1,
      "emailFrom": "surveys@example.com",
      "emailFromName": "Survey Administrator",
      "emailText": "Hello, please click on this link to complete the survey: <SURVEY_LINK>",
      "status": 2,
      "subject": "Survey Invitation",
      "surveyID": 7654321,
      "userID": 9876543
    }
  }
}
```

### Send survey to email list

Email a survey to everyone on an email list, using one of your templates.

**Inputs**

- Survey (`survey_id`, number, required): The survey. Use a survey ID from List surveys or Get survey.
- Email list (`email_list_id`, number, required): The email list to send to.
- Template (`template_id`, number, required): The email template to send.

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {
    "requestID": "7012fedc-e8ce-48ae-b800-6q5ce287987a7dje",
    "response": {
      "batchType": 1,
      "creationDate": "2020-11-05T07:14:29.000+00:00",
      "description": "Email List : Default List-0",
      "emailBatchID": 1234567,
      "emailBatchStatistics": {
        "blockedCount": 0,
        "errorCount": 0,
        "participationPendingCount": 1,
        "queuedCount": 0,
        "sentCount": 1,
        "startedCount": 0,
        "takenCount": 0,
        "unSubscribedCount": 0,
        "viewedCount": 0
      },
      "emailCount": 1,
      "emailFrom": "surveys@example.com",
      "emailFromName": "Survey Administrator",
      "emailText": "Hello, please click on this link to complete the survey: <SURVEY_LINK>",
      "status": 2,
      "subject": "Survey Invitation",
      "surveyID": 7654321,
      "userID": 9876543
    }
  }
}
```

### Send survey with your own email

Email a survey to the addresses you list, with a subject and message you write.

**Inputs**

- Survey (`survey_id`, number, required): The survey. Use a survey ID from List surveys or Get survey.
- Email addresses (`emails`, list, required): The addresses to send to. After each address you can add commas and up to five custom values.
- Subject (`email_subject`, text, required): The email's subject.
- Message (`email_content`, text, required): The email's text. It must contain <SURVEY_LINK> where the survey link goes.

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {
    "requestID": "7012fedc-e8ce-48ae-b800-6q5ce287987a7dje",
    "response": {
      "batchType": 1,
      "creationDate": "2020-11-05T07:14:29.000+00:00",
      "description": "Email List : Default List-0",
      "emailBatchID": 1234567,
      "emailBatchStatistics": {
        "blockedCount": 0,
        "errorCount": 0,
        "participationPendingCount": 1,
        "queuedCount": 0,
        "sentCount": 1,
        "startedCount": 0,
        "takenCount": 0,
        "unSubscribedCount": 0,
        "viewedCount": 0
      },
      "emailCount": 1,
      "emailFrom": "surveys@example.com",
      "emailFromName": "Survey Administrator",
      "emailText": "Hello, please click on this link to complete the survey: <SURVEY_LINK>",
      "status": 2,
      "subject": "Survey Invitation",
      "surveyID": 7654321,
      "userID": 9876543
    }
  }
}
```

### Update survey

Change a survey's name, folder, quota, closing date or status.

**Inputs**

- User ID (`owner_id`, number, required): Your QuestionPro user ID. Get survey shows it as the survey's ownerID.
- Survey (`survey_id`, number, required): The survey's ID.
- Name (`name`, text): The survey's new name.
- Status (`status`, text): The survey's status, such as Active.
- Folder (`folder_id`, number): The folder to keep it in.
- Response quota (`response_quota`, text): Close the survey after this many responses.
- Save and continue (`save_and_continue`, true/false): Let people save their answers and finish later.
- Closed message (`inactive_text`, text): The text shown once the survey is closed.
- Closes on (`expiry_date`, date): The day the survey closes.

**Outputs**

- `data` (object): The response from QuestionPro.

**Example output**

```json
{
  "data": {
    "requestID": "7012fedc-e8ce-48ae-b800-6q5ce287987a7dje",
    "response": {
      "abbs": false,
      "completedResponses": 10,
      "completedText": "Thank you for completing this survey.",
      "creationDate": "17 Nov, 2020 12:00:00 AM PST",
      "expiryDate": "12/31/2023",
      "folderID": 7654321,
      "hasScoringLogic": false,
      "inactiveText": "This Survey has been deactivated by the owner.",
      "modifiedDate": "17 Nov, 2020 03:19:07 AM PST",
      "name": "Product Satisfaction",
      "ownerID": 9587462,
      "quotaOverlimitText": "Thank you for your time but we have already received the required responses.",
      "responseQuota": 0,
      "saveAndContinue": false,
      "status": "Active",
      "surveyFinishMode": 15,
      "surveyID": 1234567,
      "surveyLanguages": [
        {
          "default": true,
          "name": "English"
        }
      ],
      "terminatedText": "Your profile does not fit our criteria. Thank you for your time",
      "thankYouMessage": "Thank you for completing this survey.",
      "url": "https://www.questionpro.com/t/XXXXXXXXXX"
    }
  }
}
```
