Mike Godin
Mike Godin

Reputation: 3937

Setting exit button text to blank through SurveyMonkey API

I've been sucessfully using the SurveyMonkey API to build up a survey. However, we'd like the exit button to be omitted from the survey, and it appears that is done by setting done_button.exit_button to an empty string. However, I can't seem to be able to set the buttons_text value, either during survey creation (PUSH), or survey modification (PATCH).

Here's an example of an API call I've made:

curl -i -X PATCH -H "Authorization:bearer [ACCESS_TOKEN]" -H "Content-Type: application/json" https://api.surveymonkey.net/v3/surveys/[SURVEY_ID]?api_key=[API_KEY] -d '{"buttons_text":{"done_button":"Done","prev_button":"Prev","exit_button":"","next_button":"Next"}}'

The response I get:

{"error": {"docs": "https://developer.surveymonkey.com/api/v3/#error-codes", "message": "Invalid schema in the body provided.", "id": "1002", "name": "Bad Request", "http_status_code": 400}}

seems to indicate that I've done something wrong in the JSON (included an invalid field name, I think)... but it's not clear what is wrong per the API documentation.

Upvotes: 0

Views: 128

Answers (2)

Adam Klockars
Adam Klockars

Reputation: 301

Both those issues should now be resolved. Providing a blank string for "exit_button" will remove it, and copying the survey with a new title will set that title.

Upvotes: 1

Mike Godin
Mike Godin

Reputation: 3937

Seems the only way is to copy an existing blank survey. This has the added advantage of allowing one to set the survey category, which is also broken in the API, as well as setting the survey theme, which is curiously unavailable in the API.

However, as of 2016/05/01, copying a survey with a new title set does not correctly set that new title. An additional PATCH request must be sent to correctly set the title.

Upvotes: 0

Related Questions