If you start a hipchat account today, you are put on v2 by default. All the v1 documents are also marked deprecated.
I added a new module parameter: version which can be set to 1 or 2.
It's close, but I still get 400 bad request when I'm using it for v2. I upgraded my hipchat account so I no longer have access to a v1 account to make sure version 1 still wroks.
Here are the API differences from what I can tell:
- The API base is: https://api.hipchat.com/v2
- The endpoint for a notification went from https://api.hipchat.com/v1/rooms/message to room/RoomName/notification
- Since room is in the request path now, it is no longer a valid parameter
- Issuing this as a GET request is no longer an option. POST only
- "room_id" is no longer a parameter
- "from" is no longer a parameter
- "format" is no longer a parameter (not to be confused with "message_format", which still is valid
I am pretty sure my forked version is close to working, but it may be my lack of experience with the plugin system... specifically how exactly AnsibleModule() impacts the plugin and how to use the fetch_url() method properly. i.e. I'm not sure what the impact of passing the AnsibleModule is into fetch_url() yet and it may be this that is the problem since I'm pretty sure I've got all the v2 parameters setting correctly before it sends the request.