Easymailing
Email campaigns

Select the survey of a campaign

PUT /campaigns/{uuid}/actions/select_survey

PUT/campaigns/{uuid}/actions/select_survey

Links an active survey to a survey campaign, so its email carries the survey block. Nothing is sent. The survey question becomes the subject if the campaign had none.

When to use: After creating a survey campaign without survey, or to switch the campaign to another survey.

When not to use: To create a survey campaign already linked, send survey to create_campaign_survey. The survey must be active (survey_activate) and belong to the campaign audience (see list_surveys). Other campaign types have no survey.

Side effects: Nothing is sent to anyone. It may create or change the campaign template: without a template, one with the survey block is created; if the template carries another survey block, only the survey is replaced. A template of your own without the block is left untouched and the response has template_has_survey_block: false and a warning: add the block ({{ block.poll.<survey_uuid> }}) before sending, because the API does not check it when sending.

Permissions: Requires the author role or higher, or the marketing.campaigns.write capability.

Authorization

X-Auth-Token<token>

Value for the X-Auth-Token header parameter.

In: header

Path Parameters

uuid*string

UUID of the email campaign (the uuid field returned by list_campaigns).

Request Body

The updated Campaign resource

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X PUT "https://api.easymailing.com/campaigns/8d4e2a71-5c3b-4f96-b1a8-6e0d9c7f2b35/actions/select_survey" \  -H "X-Auth-Token: YOUR_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "survey": "7d8f4752-8c72-470e-8064-47397877e705"  }'
{  "survey": "7d8f4752-8c72-470e-8064-47397877e705",  "template_has_survey_block": true,  "warning": "string"}