【发布时间】:2015-07-28 23:23:19
【问题描述】:
我正在尝试通过他们的 Content Management API 在 Contentful.com 上创建一个 Webhook。命令如下(注意我已经调整了各自的 ID 以保证安全):
curl -X PUT -H 'Content-Type: application/vnd.contentful.management.v1+json' -H 'Authorization: Bearer c8c3ef46d5dbfe3c841a3b4bff1ee89449669ffd407d1a62c7a0ecbad9c3120' -H 'Content-Length: 33' 'https://api.contentful.com/spaces/du8mcuj2d5la/webhook_definitions/1CtkR6S5oUqWywgEO2i0xx' -d '{"url":"https://xxx.parseapp.com"}'
无论我在最终对象中使用什么 URL(https://www.example.com 除外),我都会得到以下响应:
{
"sys":{
"type":"Error",
"id":"InvalidJsonRequestBody"
},
"requestId":"85f-1338857905",
"message":"The body you sent is not valid JSON."
}
我已使用 Paw (http://luckymarmot.com/paw) 验证端点传递接受入站 POST 请求并(返回 200 响应代码)。只是为了强调如果我将https://xxx.parseapp.com 切换到https://www.example.com 它会创建webhook。其他任何它似乎都在抱怨的东西。
【问题讨论】:
标签: json curl webhooks contentful