Respondent is an association of a contact with a survey in the user account.
One contact can be assigned to multiple surveys in an account.
List of operations for a resource
Name | URL | Description |
| Returns a list of all respondents from the survey specified by the parameter: | |
| Searches for respondents by criteria passed in the | |
| Assigns a contact to the survey | |
| Assigns a contact to the survey | |
| Sending respondents in grouped packages, for which one mailing can be created at the end |
Description of response parameters
Name/path | Description | Possible values |
| Respondent ID |
|
| A unique token that identifies the respondent. Used for one-time survey completion by the respondent. The parameter is active only with the highest level of survey access. |
|
| Information on whether the invitation to complete the survey is carried out by startquestion.com or by the author of the survey. Providing the user_token in the link to complete the survey is also treated as distribution by the author. |
|
| Date of adding a respondent to the survey |
|
| Date and time of sending the invitation |
|
| Date and time of first opening of the survey The parameter is active only with the highest level of survey access. |
|
| Date and time of filling out the survey. The parameter is active only with the highest level of survey access. |
|
| Is the answer of the respondent postponed when filling out? The parameter is active only with the highest level of survey access. |
|
| Email address of the respondent |
|
| Value of the first optional label. Label active if the respondent was added from user contact. |
|
| Value of the second optional label. Label active if the respondent was added from user contact. |
|
| Value of the third optional label. Label active if the respondent was added from user contact. |
|
| Value of the fourth optional label. Label active if the respondent was added from user contact. |
|
| Value of the fifth optional label. Label active if the respondent was added from user contact. |
|
| Value of the sixth optional label. Label active if the respondent was added from user contact. |
|
| Value of the seventh optional label. Label active if the respondent was added from user contact. |
|
| Value of the eighth optional label. Label active if the respondent was added from user contact. |
|
| Value of the ninth optional label. Label active if the respondent was added from user contact. |
|
| Value of the tenth optional label. Label active if the respondent was added from user contact. |
|
| Value of the eleventh optional label. Label active if the respondent was added from user contact. |
|
| Value of the twelfth optional label. Label active if the respondent was added from user contact. |
|
| Value of the thirteenth optional label. Label active if the respondent was added from user contact. |
|
| Value of the fourteenth optional label. Label active if the respondent was added from user contact. |
|
| Value of the fifteenth optional label. Label active if the respondent was added from user contact. |
|
| Unique link to the survey intended for a given respondent. The parameter is active only with the highest level of survey access. |
|
Respondent list
URL
(GET) https://www.startquestion.com/api/v2/respondents/:id_survey
Optional parameters (POST)
Name | Description |
| Limit for the number of filled out surveys |
| Offset for the list |
Sample response
{
"total":"20",
"list":[{
"id":100824,
"token":"549E56",
"date_token_generate":"2011-11-25 22:27:42",
"date_invitaion_send":null,
"date_survey_open":null,
"date_survey_answer":null,
"email":"jan@kowalski.pl",
"label1":"Jan",
"label2":"Kowalski",
"label3":"600 700 800",
"label4":"",
"label5":"",
"answer_postponed":null
},{
...
}]
}
Returned errors
401 Unauthorized
– If the user refers to a foreign resource.
404 Not Found
– If a survey with the specified :id_survey was not found.
404 Not Found
– If respondents were not found.
406 Not Acceptable
– If the :id_survey parameter was not provided.
Searching respondents
URL
(GET)https://www.startquestion.com/api/v2/respondents/search/:id_survey
Optional parameters (POST)
Name | Description |
| Limit for the number of filled out surveys |
| Offset for the list |
| Searching for a respondent by the token |
| Searching for a respondent by the email address |
| Searching for a respondent by the date of adding them to the survey. The date must be provided in the following format: |
| Searching for a respondent by the date of sending the invitation. The date must be provided in the following format: |
| Searching for a respondent by the date first opening of the survey. The date must be provided in the following format: |
| Searching for a respondent by the date first filling out of the survey. The date must be provided in the following format: |
| Searching for a respondent by the value of label 1 |
| Searching for a respondent by the value of label 2 |
| Searching for a respondent by the value of label 3 |
| Searching for a respondent by the value of label 4 |
| Searching for a respondent by the value of label 5 |
| Searching for a respondent by the value of label 6 |
| Searching for a respondent by the value of label 7 |
| Searching for a respondent by the value of label 8 |
| Searching for a respondent by the value of label 9 |
| Searching for a respondent by the value of label 10 |
Sample response
{
"total":"20",
"list":[{
"id":100824,
"token":"549E56",
"date_token_generate":"2011-11-25 22:27:42",
"date_invitaion_send":null,
"date_survey_open":null,
"date_survey_answer":null,
"email":"jan@kowalski.pl",
"label1":"Jan",
"label2":"Kowalski",
"label3":"600 700 800",
"label4":"",
"label5":"",
"answer_postponed":null
},{
...
}]
}
Returned errors
401 Unauthorized
– If the user refers to a foreign resource.404 Not Found
– If a survey with the specified :id_survey was not found.404 Not Found
– If respondents were not found.406 Not Acceptable
– If the :id_survey parameter was not provided.
Adding a respondent to the survey
URL
(GET) https://www.startquestion.com/api/v2/respondents/add
Parameters (POST)
Name | Description |
| ID of the survey to which the contact is assigned |
| ID of the contact which is assigned to the survey |
| Date of sending an invitation to the respondent (mailing was done by the customer’s application). |
Sample response
{
"id_respondent":"101019"
}
Returned errors
401 Unauthorized
– If the user refers to a foreign resource (survey/contact).404 Not Found
– If a survey with the specified :id_survey was not found.404 Not Found
– If a contact with the specified :id_contact was not found.406 Not Acceptable
– If the :id_survey parameter was not provided.406 Not Acceptable
– If the :id_contact parameter was not provided.409 Conflict
– If the contact has already been added to the survey.
Deleting a respondent
URL
(GET) https://www.startquestion.com/api/v2/respondents/delete
Parameters (POST)
Name | Description |
| ID of the survey to which the contact belongs |
| Respondent ID |
Sample response
{
"status":"ok"
}
Returned errors
401 Unauthorized
– If the user refers to a foreign resource (survey/contact).404 Not Found
– If a survey with the specified :id_survey was not found.404 Not Found
– If a respondent with the specified :id_respondent was not found.
Batch upload of respondents
The process is to enable sending respondents in grouped packages, for which one mailing can be created at the end The whole process is as follows:
Create a new batch (POST webankieta.pl/api/v2/respondents/batch) after successful batch creation, you will receive its id under which you will group individual respondent batches.
1. CREATING - POST
(POST) startquestion.com/api/respondents/batch
Parameters (POST)
Name | Description |
| ID of the survey to which respondents will be imported. |
Sample response
{
"batch_id":"89f7fcdb-c8c9-4414-8ec7-423780f66901"
}
2. DOWNLOADING - GET
(GET) startquestion.com/api/respondents/batch
Parameters (GET)
Name | Description |
| ID of the batch |
Returned values in json:
Name | Description |
| ID of the batch |
| Account ID |
| Survey ID |
| ID list of assigned patches |
Returned errors
401 Unauthorized – If the user refers to a foreign resource (survey/contact).
400 An error occurred – If the operation is unsuccessful
Troubleshooting:
we know of cases where many of the same email addresses are imported in one batch. When sending mailings using the created batch, all messages are sent at once. It may happen that the mail server will block these messages due to a potential SPAM (sending many identical messages in one second). We suggest to limit the existence of many identical email addresses in the batch as much as possible within one mailing process.
Add new respondents batches to the previously created batch (POST webankieta.pl/api/v2/respondents/patch). Each batch must be sent with the batch_id parameter equal to the one created earlier. The recommended number of respondents in one package is 20.
3. SENDING RESPONDENT BATCH - POST
(POST) startquestion.com/api/v2/respondents/patch
Parameters (POST)
Name | Description |
| ID of the batch |
| respondent table (recommended up to 20) |
respondents |
|
|
|
| table of respondent label value (max 15) |
Returned json values:
Name | Description |
| Patch ID |
Sample use:
In API operations, the required format of the data provided in the request parameters is application/x-www-form-urlencoded.
A data portion in the form of JSON should be converted to the above-mentioned format. For example:
{
"batch_id": "example_batch_id",
"respondents": [
{
"email": "jan.kowalski@webankieta.pl",
"labels": [
"Warszawa",
"Support"
]
},
{
"email": "tomasz.nowak@webankieta.pl",
"labels": [
"Łódź",
"IT"
]
},
{
"email": "zenon.martyniuk@webankieta.pl",
"labels": [
"Warszawa",
"IT"
]
}
]
}
Convert it to the following form:
batch_id=example_batch_id&respondents[0][email]=jan.kowalski%40webankieta.pl&respondents[0][labels][0]=Warszawa&respondents[0][labels][1]=Support&respondents[1][email]=tomasz.nowak%40webankieta.pl&respondents[1][labels][0]=%C5%81%C3%B3d%C5%BA&respondents[1][labels][1]=IT&respondents[2][email]=zenon.martyniuk%40webankieta.pl&respondents[2][labels][0]=Warszawa&respondents[2][labels][1]=IT
You can do that using the sample Javascript code:
function jsonToUrlEncoded(element,key,list) {
list = list || [];
if(typeof(element)=='object'){
for (var idx in element)
jsonToUrlEncoded(element[idx],key?key+'['+idx+']':idx,list);
} else {
list.push(key+'='+encodeURIComponent(element));
}
return list.join('&');
}
console.log(jsonToUrlEncoded( {OBIEKT} ));
In the {OBIEKT} place, enter the object you want to convert to the format of your choice.
4. DOWNLOADING RESPONDENTS- GET
(GET) startquestion.com/api/v2/respondents/patch
Parameters (GET)
Name | Description |
| Patch ID |
Returned json values:
Name | Description |
| ID list of respondents created as part of one patch |
Returned errors
401 Unauthorized
– If the user refers to a foreign resource (survey/contact).400 An error occurred
– If the operation is unsuccessful
Once you have already added all respondents, you can send them all invitations by providing the previous batch_id (POST webankieta.pl/api/v2/mailing/batch). The documentation relating to this step can be found here.