【发布时间】:2016-12-14 18:57:37
【问题描述】:
我正在尝试从 v3 SurveyMonkey api 发送消息。为此,我使用 API 要求的以下模式:
POST /surveys/{id}/collectors
POST /collectors/{id}/messages
POST /collectors/{id}/messages/{id}/recipients/bulk
POST /collectors/{id}/messages/{id}/send
步骤 1-3 工作正常,但是当我尝试发出发送命令时,我收到 400 Bad Request 错误。错误消息指出:
"The body provided was not a proper JSON string."
如果有帮助,我正在使用 R 中的 httr 包发送消息。
u <- paste('https://api.surveymonkey.net/v3/collectors', collectorID, "messages", messageID, "send", sep="/")
h <- httr::add_headers(Authorization = token)
out <- httr::POST(u, config = h)
当我查看 API 文档时,该命令似乎不需要正文。我错过了什么?
【问题讨论】:
标签: httr surveymonkey