调查猴子 - 通过 API v3 自定义值 [英] Survey Monkey- Custom Values via API v3

查看:40
本文介绍了调查猴子 - 通过 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

我看到了所需的字段:

  1. custom_variables.a = [变量列名]
  2. 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=[#]

  1. data.0.custom_value = 空白
  2. data.0.recipient_id = 空白

10/6/16 更新:更改自定义变量计划要求

更改说明:使黄金计划及更高版本可以访问调查自定义变量.

Description of Changes: Make survey custom variables accessible to Gold plan and above.

受影响的端点:/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

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 收集器.自定义变量也存储在调查中,因此当您 fetch

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆