Create a survey
POST /audiences/{audienceUuid}/surveys
/audiences/{audienceUuid}/surveysCreates a survey in draft status for the audience. Type poll takes exactly one question votable with one click from the email (single_choice, yes_no, rating or nps); type page takes any number of questions of any type. Questions can also be added later via the update endpoint. Activate the survey (PUT .../actions/activate) before linking it to a campaign. Requires a STARTER plan or higher.
When to use: To prepare a poll or survey whose answers you want to collect from the subscribers of an audience. It stays a draft: activate it with survey_activate before linking it to a campaign.
When not to use: To change an existing survey use update_survey.
Permissions: Requires the manager role or higher, or the marketing.surveys.write capability.
Value for the X-Auth-Token header parameter.
In: header
Path Parameters
UUID of the audience the survey belongs to. Get it with list_audiences.
The new Survey 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 POST "https://api.easymailing.com/audiences/0df14405-90ff-4287-b3e4-ef088901ee6f/surveys" \ -H "X-Auth-Token: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "type": "poll", "locale": "string", "questions": [ { "text": "string", "type": "single_choice", "required": true, "display": "default", "options": [ { "text": "string" } ] } ] }'{ "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "name": "string", "type": "poll", "status": "draft", "locale": "string", "show_results": true, "redirect_url": "http://example.com", "questions": [ { "answer_field": "string", "position": 0, "text": "string", "type": "single_choice", "display": "default", "required": true, "options": [ { "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "text": "string", "position": 0 } ] } ], "public_url": "http://example.com", "audience": "/entity/1", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}