HipchatAPIv2Client
HipchatAPIv2Client copied to clipboard
webhook
Hi, I'd like to start working on webhook support (Get All, Create, Get, Delete), was there any plan for this? I don't want to go against the plan if any. I was thinking of creating a Webhook model and start by implementing the 4 API functions as a first step. any thoughts?
Hi @eleclerc , there aren't any plans for Webhooks. You can go ahead and implement those API functions, i will happily merge it.
That would be the first step to have Webhook support. In future versions we should also implement webhook reception.
Webhook reception implementation proposal
As this is a standalone library we should provide developers with methods to parse and serialize the response to a Webhook , routing won't be implemented in this library. Maybe a HipchatBundle for Symfony could manage that, it's in my to do list.
According to docs there are 5 webhooks:
- room_enter
- room_exit
- room_message
- room_notification
- room_topic_change
As room enter and exist contain the same data, WebhookRoom
should be enough for both. Other webhooks will have own model. That will make 4 models:
-
WebhookRoom
-
WebhookMessage
-
WebhookNotification
-
WebhookTopic
All of them share many properties so it will be nice to have an AbstractWebhookResponse
This is are my thoughts on the webhook implementation, but you can expose your too. But let's have those API calls first and this will came later.
Thanks!!
awesome, I wrote support for getAllWebhooks, deleteWebhook and createWebhook, , will clean it up and add phpspec files before creating a PR (I never used phpspec before...)
Perfect, if you need some help with those spec, let me know