ansible/ansible-modules-extras — pull request #118 by mikemilano (2014-11-24 21:41:15+00:00)
Title: Hipchat v2 + legacy v1 support

I updated the hipchat module to work with v2, as well as v1. There is a new module parameter, `version` which can be set to `1` or `2`.

I no longer have a v1 account so I am not able to test if this will still work for v1. If not, it should be minor fixes.

I did not get `notify` to work with the v2 API. It defaults to false. The API specifies it wants a boolean value but does not accept anything. I tested it in with numeric, string, and boolean values from the plugin code, as well as tested with postman (chrome app). All values I tested generate a bad request error stating the valid type should be boolean. `notify` will be ignored right now when `version` is set to 2.

The API changes are as follows:
- base changed from: `https://api.hipchat.com/v1` to `https://api.hipchat.com/v2`
- path changed from: `rooms/message` to `room/id_or_name/notification`
- method changed from `POST` or `GET` to `POST` only
- `room_id` is no longer a parameter since it is defined in the path
- `from` is no longer a parameter. This is now the user who owns the token, or the notification label setup with the token.
- `format` is no longer a parameter (not to be confused with `message_format`, which is still valid

V1: https://www.hipchat.com/docs/api/method/rooms/message
V2: https://www.hipchat.com/docs/apiv2/method/send_room_notification