How to create a webhook for HipChat

1.6k Views Asked by At

I like to create a webhook for HipChat so that e.g. when typing /sayhi in the chat, a simple Hi is returned.

I looked at their api https://www.hipchat.com/docs/apiv2/method/create_room_webhook where it is said to send a PUT to

/v2/room/{room_id_or_name}/extension/webhook/{key}

So I made the following script

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

but running this returns

{
 "error": {
 "code": 405,
 "message": "<p>The method is not allowed for the requested URL.</p>",
 "type": "Method Not Allowed"
 }
}

Can someone explain how to set up this correctly ? Thanks for any help

1

There are 1 best solutions below

0
On

Found finally https://developer.atlassian.com/hipchat/tutorials/building-a-simple-add-on-using-a-wizard where it is explained in detail and with this it was working.

At the end it was a misconfiguration on my side