如何为HipChat创建一个webhook

时间:2016-02-19 08:19:52

标签: webhooks hipchat

我想为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"
 }
}

有人可以解释一下如何正确设置吗?谢谢你的帮助

1 个答案:

答案 0 :(得分:1)

最后找到了https://developer.atlassian.com/hipchat/tutorials/building-a-simple-add-on-using-a-wizard,详细解释了这一点,并且它正在发挥作用。

最后,我身边的配置错误