Send surveys
Endpoints
Browse a specific survey's sendings: GET surveys/{surveyId}/sendings
Read a specific survey's sendings: GET surveys/{surveyId}/sendings
Send a specific survey POST surveys/{surveyId}/sendings
Request Data Type
{
"participants": [
"5f806d30591746f32872e96e"
],
"newParticipants": [
{
"phoneNumber": "46712345678",
"emailAddress": "test@example.com",
"properties": {
"firstName": "John"
}
}
],
"channels": [
"Sms",
"Email"
],
"defaultProperties": {
"firstName": ""
},
"deliveryWindows": [
{
"opens": "2021-11-12T11:57:12.2013982Z",
"closes": "2021-11-19T11:57:12.2013982Z"
}
],
"sms": {
"sender": "iP1",
"body": "Survey time {firstName}"
},
"email": {
"sender": "iP1",
"subject": "Survey time",
"message": "Here's the survey"
}
}
deltagare
A collection of IDs for participants in the sending. For inquiries, this is a list of past participants to remind you of.
newParticipants
A collection of data to create new participants. Max 1000. These are converted and moved to participants during processing.
phoneNumber
The phone number to use when sending on the SMS channel.
emailAddress
The email address to use when sending on the email channel.
properties
A dictionary of additional properties that can be used when you template messages. Can also be used to categorize participants and template questions.
channels
Which channels the broadcast should be sent on. Valid values are SMS and Email. More may be added in the future. At least one is required, and only participants who have applicable target properties will be sent on specific channels (e.g. phone number for SMS).
defaultProperties
Like participant properties but default values used when a participant lacks the specific property.
deliveryWindows
If there is a need to schedule a shipment in the future, there is the option to do so with our delivery time windows.
You can have as many windows as you want. This allows you to send messages at specific times over several days, for example, every day between 10:00 and 10:05 on weekdays.
Parsing
null
in the field opened will be replaced with the current date and time.- If
closes
isnull
the field will be set to 7 days (168 hours) after the field is opened
The request will be rejected if windows overlap.
If no windows are given, we will create a window that will apply the parsing rule above.
sms
Channel-specific details for the SMS channel.
Channel-specific information for the email channel.
sender
Sender name/ID to use for either SMS or email.
body
SMS message text. Participant properties can be created as templates using brackets ({}). A special template {url} can be added to place the link to the survey at a specific location in the message. If {url} is not included, it will be added after two line breaks at the end of the message.
subject
The email subject to use in all emails.
message
A message to participants that will be included in the emails along with the link to the survey.
Response data type
{
"id": "600ade98a11bf89ac18b5d76",
"surveyId": "5f9028d2d60d0f12d4db4e67",
"status": "Delivered",
"participants": [
"5f806d30591746f32872e96e",
"5f903a70490f3c2d48fea8d3"
],
"newParticipants": [],
"channels": [
"Sms",
"Email"
],
"defaultProperties": {},
"deliveryWindows": [
{
"opens": "2021-11-12T11:57:12.2013982Z",
"closes": "2021-11-19T11:57:12.2013982Z"
}
],
"sms": {
"sender": "iP1",
"body": "Survey time {firstName}\n\n{url}",
"batchId": "600ade99e66b6b1fc8aada38",
"pendingParticipants": [],
"deliveredParticipants": [
"5f806d30591746f32872e96e",
"5f903a70490f3c2d48fea8d3"
],
"failedParticipants": [],
"status": "Delivered"
},
"email": {
"sender": "iP1",
"subject": "Survey time",
"message": "Here's the survey",
"emailIds": [
"2c2d2930b0254b8fb8a834670e7f31ef",
"ec0814ff12074597b6fb73d85f5261c6"
],
"pendingParticipants": [],
"deliveredParticipants": [
"5f806d30591746f32872e96e",
"5f903a70490f3c2d48fea8d3"
],
"failedParticipants": [],
"status": "Delivered"
}
}
id
Sending ID, used to refer to the sending
surveyId
Survey ID of the survey to which the sending belongs.
status
The current status of the broadcast or a specific channel. Available statuses include the following.
Status | Description |
---|---|
New | The sending has just been created and no processing has started. |
Pending | The sending has started the first stage of processing, generating participants |
Ready | The broadcast or channel is ready to be sent. |
Failed | The broadcast or channel could not be delivered. |
Sent | The broadcast or channel has been sent but delivery is still unconfirmed |
Delivered | The broadcast or channel has been delivered in full or externally scheduled |
batchId
SMS batch ID that refers to sent or scheduled messages on the SMS channel.
emailIds
Email IDs that refer to sent or scheduled emails on the email channel.
pendingParticipants
ID of the channel participant whose message is waiting for delivery.
deliveredParticipants
ID of channel participant whose message delivery has been confirmed or scheduled externally.
failedParticipants
ID of channel participant whose message could not be delivered.