Pregunta

For a given survey, how do you determine its survey_id for use with the SurveyMonkey API?

A list of all IDs is returned by the API method get_survey_list, and you could subsequently call get_survey_details on each survey to determine which one is the intended one, but that seems needlessly complicated. There has to be a way to get a survey's ID from the My Surveys page, right?

Edit:

Whoops, get_survey_details isn't actually necessary, since get_survey_list can take a fields parameter that includes the survey's title.

¿Fue útil?

Solución

If you want to get the survey ID via the web page you can:

  • Right click on the survey in the "ALL SURVEYS" surveys view, and press "Inspect Element" or "Inspect" depending on your browser.

  • In the bottom of the browser, you will see a highlighted block that starts with: <a href="/summary/...

  • Scroll up a few lines until you see a line that starts with: <tr class="survey-row" id=`

  • The number that follows id= is the survey id, which you can then use in the API.

Otros consejos

Nothing much to add to what Tony & Miles said, just that my UI form contains these fields:

1) An Age limit - eg the past 365 days

2) A keyword in the title - typically all the surveys for one client have that client's name in the title. Hint: if you can be organised enough to enforce a convention, and put keywords in the nickname, the nickname is what the API looks in for Title, although what the user sees is the other title.

3) A start date to get responses only after a start date - the first day may have been only a test.

4) A combobox with all the matching surveys is presented showing the title, number of respondents, date created and date recently modified, pretty much the same as what appears in the SurveyMonkey web UI. That's where they pick the one they want.

HTH

Patrick

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top