Update a survey
PUT /audiences/{audienceUuid}/surveys/{uuid}
/audiences/{audienceUuid}/surveys/{uuid}Updates the survey name and configuration (show_results, redirect_url) in any status. Sending questions REPLACES the whole question set and is only allowed while the survey is in draft (questions are immutable once activated).
When to use: To rename a survey, change whether respondents see the results or where they go after answering, or (only while it is a draft) rewrite its questions.
When not to use: To make the survey available to campaigns use survey_activate.
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.
UUID of the survey. Get it with list_surveys.
The updated 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 PUT "https://api.easymailing.com/audiences/0df14405-90ff-4287-b3e4-ef088901ee6f/surveys/b7d2f6a3-1c48-4e9b-8a05-6f3e2d1c9b74" \ -H "X-Auth-Token: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "show_results": true, "redirect_url": "http://example.com", "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"}