通过API v3调查猴子-自定义值 [英] Survey Monkey- Custom Values via API v3
问题描述
我目前无法弄清楚如何通过API获取多个自定义字段。 Excel提取提供了我需要的列,但是我找不到v3 GET或POST协议来获取所需的字段。
I am currently unable to figure out how to obtain several custom fields via the API. The Excel extracts provide the columns I need, but I cannot find a v3 GET or POST protocol to obtain the desired fields.
来自:
api.surveymonkey。 net / v3 / surveys / [survey_id] / details
From: api.surveymonkey.net/v3/surveys/[survey_id]/details
我看到了所需字段:
- custom_variables.a = [变量a列名]
- custom_variables.b = [变量b列名]
具有以下内容:api.surveymonkey.net/v3/surveys/[survey_id]/responses/bulk?page = [#]& per_page = [#]
With the following: api.surveymonkey.net/v3/surveys/[survey_id]/responses/bulk?page=[#]&per_page=[#]
- data.0.custom_value =空白
- data.0.recipient_id =空白
16/10/6更新:更改自定义变量计划要求
更改说明:使调查自定义变量可用于Gold计划及更高版本。
Description of Changes: Make survey custom variables accessible to Gold plan and above.
受影响的端点:/调查,/调查/ {id}, /调查/ {id} /响应/ bulk ,/ collectors / {id} / responses / bulk,/ surveys / {id} / responses / {id},/收藏家/ {id} /响应/ {id},/ surveys / {id} /响应/ {id} /详细信息,/ collectors / {id} /响应/ {id} /详细信息
Endpoints Affected: /surveys, /surveys/{id}, /surveys/{id}/responses/bulk, /collectors/{id}/responses/bulk, /surveys/{id}/responses/{id}, /collectors/{id}/responses/{id}, /surveys/{id}/responses/{id}/details, /collectors/{id}/responses/{id}/details
我达到了我的API调用限制,但还无法运行/ collectors / {id} / responses。我认为最好现在问一下并得到正确的答案(这样我就可以完成此项目并在我的计数器重设时按时完成任务)。作为信息,我正在使用Alteryx进行呼叫,一旦完成此工作,就将工作流发布到Alteryx网站上(以回馈社区)。
I hit my API call limit and have not been able to run the /collectors/{id}/responses yet. I thought it best to ask now and get the right answer (so I can finish off this project and hit my deadline when my "counter" gets reset). As information I am using Alteryx to make the calls, and once I get this piece completed will be posting the Workflow on the Alteryx site (to give a little back to the community).
预先感谢您的帮助!
提请
推荐答案
因此,这是两种不同的自定义值。
So those are two different kinds of "custom values".
有自定义变量,它们基本上是URL参数,将被接受并与调查响应一起存储。这些仅适用于非基于电子邮件的收集器,尤其是Weblink收集器。自定义变量也存储在调查中,因此当您获取时,
There are Custom Variables which are basically URL parameters that will be accepted and stored with the survey response. These only work for non-email based collectors, particularly for a Weblink collector. The custom variables are also stored on the Survey, so when you fetch with
GET /v3/surveys/<survey_id>
您会收到类似
{
"title": "My Survey",
"custom_variables": {
"name1": "label1",
"name2": "label2"
...
},
...
}
然后当您获取调查答复(假设已填写),您将得到如下答复:
Then when you fetch survey responses, assuming they were filled in, you would get a response back like this:
GET /v3/surveys/<survey_id>/responses/<response_id>
{
"id": "<response_id>",
"response_status": "completed",
"custom_variables": {
"name1": "value1",
"name2": "value2"
...
},
...
}
关于自定义值,这些是自定义数据,存储在地址簿的联系人资源中,用于在电子邮件收集器(不是调查)上创建收件人。
With regards to Custom Values, these are custom data stored on a Contact resource in your address book used to create a recipient on an Email collector (not the Survey).
因此,当您创建新收件人在电子邮件收集器上,您可以设置 custom_fields
,这些存储在联系人和收件人中。当您获取该收件人时,它将看起来像这样:
So when you create a new recipient on an email collector, you can set custom_fields
which are stored on the contact as well as the recipient. When you fetch that recipient, it'll look something like this:
GET /v3/collectors/<collector_id>/recipients/<recipient_id>
{
"id": "<recipient_id>",
"email": "<email>",
"first_name": "<first_name>",
"last_name": "<last_name>",
"custom_fields": {
"1": "field1",
"2": "field2",
"3": "field3",
...
}
...
}
然后,当特定收件人回答调查并获取响应时,您将在响应元数据中获得联系信息,例如:
And then when that specific recipient answers the survey and you fetch the response, you will get the contact information in the response metadata like:
GET /v3/surveys/<survey_id>/responses/<response_id>
{
"id": "<response_id>",
"response_status": "completed",
"metadata": {
"contact": {
{
"id": "<response_id>",
"response_status": "completed",
"metadata": {
"contact": {
"first_name": {
"type": "string",
"value": "<first_name>"
},
"last_name": {
"type": "string",
"value": "<last_name>"
},
"name1": {
"type": "string",
"value": "value1"
},
"name2": {
"type": "string",
"value": "value2"
},
"name3": {
"type": "string",
"value": "value3"
}
},
...
},
...
}
...
},
...
}
}
请注意,元数据将仅在批量响应端点。这是当前批量响应的局限性。
Note that metadata will only have the first name, last name, and email in the bulk responses endpoint. This is a current limitation in bulk responses.
希望能帮助澄清差异。
这篇关于通过API v3调查猴子-自定义值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!