简体   繁体   中英

How to add a questi0n to a survey in the surveymonkey API

I need to create "personally customized" surveys programmatically.

I know how to create a new survey from a template (create_flow), but can I then add customized questions to that survey?

And sorry for the "questi0n" in the title. stack overflow won't let me use "question" in the title! seriously.

The endpoint you're mentioning create_flow is a V2 endpoint, I would recommend using V3 of the SurveyMonkey API as V2 is likely being deprecated soon. Also V3 has a lot more functionality.

Look at the docs for v3 . Particularly creating surveys . You can create surveys with your survey data at the following endpoint:

POST /v3/surveys

Create a page at:

POST /v3/surveys/<survey_id>/pages

Create a question:

POST /v3/surveys/<survey_id>/pages/<page_id>/questions

You can update an existing question with

PATCH /v3/surveys/<survey_id>/pages/<page_id>/questions/<question_id>

Or replace it altogether at

PUT /v3/surveys/<survey_id>/pages/<page_id>/questions/<question_id>

Basically manipulate the survey however you'd like with a RESTful API. You can see in the docs the specific payload examples. I think it is a much better idea to use V3 to do what you want, I'm not sure what you are asking for is supported in V2.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM