[英]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? 我知道如何从模板(create_flow)创建新的调查,但是我可以向该调查添加自定义问题吗?
And sorry for the "questi0n" in the title. 对于标题中的“ questi0n”,我们深表歉意。 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. 您提到的
create_flow
端点是V2端点,我建议使用SurveyMonkey API的V3,因为V2可能很快就会被弃用。 Also V3 has a lot more functionality. V3还具有更多功能。
Look at the docs for v3 . 查看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. 基本上可以使用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.
我认为使用V3做您想要的事情是一个更好的主意,我不确定V2是否支持您的要求。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.