【问题标题】:Including images in survey monkey在调查猴子中包括图像
【发布时间】:2017-07-07 20:13:17
【问题描述】:

我正在尝试将图片作为调查问题包含在内,但出现以下错误,

surveymonty.exceptions.SurveyMontyAPIError: {"error": {"docs": "https://developer.surveymonkey.com/api/v3/#error-codes", "message": "无法验证字段 'headings' 列表架构:'properties' 未定义的其他属性不是字段'_data'中允许”,“id”:“1002”,“name”:“Bad Request”,“http_status_code”:400}}

我正在使用下面的 JSON 代码,

payload ={
    "headings": 
    [
            {
            "heading": "This is a monkey",
            "image":    {
                "img_url": "https://raw.githubusercontent.com/SurveyMonkey/public_api_docs/master/images/presentation.png"
                    }
             }
        ],
    "position": 4,
    "family": "presentation",
    "subtype": "descriptive_text"
    }

请帮忙!

【问题讨论】:

  • 请不要将文本作为图像进行分页。请复制粘贴实际文本本身。

标签: python json api surveymonkey


【解决方案1】:

您可能正在寻找 image 子类型,有效负载应该看起来更像:

{
    "headings": [{
        "heading": "This is a monkey",
        "image": {
            "url": "https://raw.githubusercontent.com/SurveyMonkey/public_api_docs/master/images/presentation.png"
        }
    }],
    "position": 4,
    "family": "presentation",
    "subtype": "image"
}

【讨论】:

  • 如何在上面的代码中为“图像”类型的问题添加“答案”字段?
  • payload ={ "headings": [ { "heading": "这是什么猴子?", "image": { "url": "" } } ], "position ": 1, "family": "single_choice", "subtype": "vertical", "answers": { "choices":[ { "text": "Capuchin" }, { "text": "Mandrill" }, ], "其他":[ { "text": "其他", "num_chars": 100, "num_lines": 3 } ] } }
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-02-18
  • 1970-01-01
相关资源
最近更新 更多