我喜欢为 HipChat 创建一个 webhook,以便例如/sayhi
在聊天中输入一个简单Hi
的返回。
我查看了他们的 api https://www.hipchat.com/docs/apiv2/method/create_room_webhook据说可以发送 PUT 到
/v2/room/{room_id_or_name}/extension/webhook/{key}
所以我做了以下脚本
curl -d '{"name":"simpletest","url":"http://myserser/myapp/myresource",
"pattern":"^\\/hello$","key":"my.simple.webhook","event":"room_message"}'
-H 'Content-Type: application/json'
https://our.hipchat.com/v2/room/2202432/extension
/webhook/my.simple.webhook?auth_token=token
但运行此返回
{
"error": {
"code": 405,
"message": "<p>The method is not allowed for the requested URL.</p>",
"type": "Method Not Allowed"
}
}
有人可以解释如何正确设置吗?谢谢你的帮助