Skip to main content
Mailing
Artur Zbiejcik avatar
Written by Artur Zbiejcik
Updated over a year ago

List of operations for resource

Name

URL

Description

/mailing/templates

Returns a list of all mailing templates for a logged in user. Templates sorted by date of adding (ascending).

/mailing/create

Creates mailing with invitations to the survey

/mailing/batch

Operation for defining mailing. To define a mailing, you have to add respondents to the patch

Description of parameter responses

Name/path

Description

Possible values

id

Survey id

name

Template title

subject

Mailing subject title

content

Mailing content

date_created

Date of template creation

id_mailing

ID of the mailing created in the system

receivers

Number of respondents who will receive an invitation

footer

possibility to enable footer with information about the sender. The footer is disabled by default

1 - footer turned on

0 - footer turned off

List of mailing templates

URL

(GET) https://www.startquestion.com/api/v2/mailing/templates

Sample response

{
["total"] => string(1) "2"
["list"] => array(2) {
[0] => array(5) {
["id"] => int(7)
["name"] => string(7) "Testowa"
["subject"] => string(35) "Zaproszenie do wypełnienia ankiety"
["content"] => string(251) "<p>Witaj,<br /> <br /> Zapraszam do wypełnienia ankiety na temat ...<br /> Wypełnienie ankiety powinno zająć około ... minut<br /> <br /> Aby wypełnić ankietę kliknij na link:<br /> [LINK]<br /> <br /> <br /> <br /> Dziękuję i pozdrawiam</p>"
["date_created"] => string(19) "2015-04-24 13:36:00"
}
[1] => array(5) {
["id"] => int(8)
["name"] => string(8) "Testowa2"
["subject"] => string(35) "Zaproszenie do wypełnienia ankiety"
<p>testowa 2<br /> <br /> Zapraszam do wypełnienia ankiety na temat ...<br /> Wypełnienie ankiety powinno zająć około ... minut<br /> <br /> Aby wypełnić ankietę kliknij na link:<br /> [LINK]<br /> <br /> <br /> <br /> Dziękuję i pozdrawiam</p>"
["date_created"] => string(19) "2015-04-24 13:36:19"
}
}
}

Returned errors

None

Creating mailing


URL

(POST) https://www.startquestion.com/api/v2/mailing/create


POST parameters

Nazwa/ścieżka

Opis

Możliwe wartości

id_survey

survey ID

id_template

message template ID

date_send

date of mailing dispatch (Y-m-d H:M:s)

mode

mailing dispatch mode

all - every imported respondent selected

new - only respondents, that were not invited yet

reminders - dispatch to the respondents that were already invited, but did not fill out the survey

selected - only selected respondents

respondent_ids

list of respondent IDs, separated with comma; required when mode=selected

footer

possibility of disabling the footer with information about the sender. The footer is disabled by default

Exemplary response

[
{
["id_mailing"] => string(3) "585",
["receivers"] => int(0)
}
]

Returned errors


• 400 Bad request – Incorrect date format/incorrect status or incorrect security level in survey
• 401 Unauthorized – Access denied to selected template ID
• 403 Forbidden – Limit of the sent messages are used for given account
• 404 Not found – Survey with given ID was not found for given account
• 500 Internal Server Error

Mailing invitations using batch_id

POST

(POST) startquestion.com/api/v2/mailing/batch

Parameters (POST)

Name

Description

batch_id

Batch ID

template_id

ID of the selected template for mailing

with_reminder

bool value deciding whether a reminder is to be sent to respondents who did not fill out the survey. Optional parameter Default value: false.

reminder_template_id

ID of the selected template for sending reminders. This parameter is required if parametr with_reminder was set to true. How to obtain template_id?

reminder_delay

number of hours from mailing after which a reminder is to be sent to respondents who did not fill out the survey. This parameter is required if parameter with_reminder was set to true.

Returned json values:

Name

Description

mailing_id

ID of the created mailing

Did this answer your question?