{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/118","labels_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/118/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/118/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/118/events","html_url":"https://github.com/ansible/ansible-modules-extras/pull/118","id":49946180,"number":118,"title":"Hipchat v2 + legacy v1 support","user":{"login":"mikemilano","id":1287855,"avatar_url":"https://avatars.githubusercontent.com/u/1287855?v=3","gravatar_id":"","url":"https://api.github.com/users/mikemilano","html_url":"https://github.com/mikemilano","followers_url":"https://api.github.com/users/mikemilano/followers","following_url":"https://api.github.com/users/mikemilano/following{/other_user}","gists_url":"https://api.github.com/users/mikemilano/gists{/gist_id}","starred_url":"https://api.github.com/users/mikemilano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikemilano/subscriptions","organizations_url":"https://api.github.com/users/mikemilano/orgs","repos_url":"https://api.github.com/users/mikemilano/repos","events_url":"https://api.github.com/users/mikemilano/events{/privacy}","received_events_url":"https://api.github.com/users/mikemilano/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/feature_pull_request","name":"feature_pull_request","color":"009800"},{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/P4","name":"P4","color":"bfe5bf"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2014-11-24T21:41:15Z","updated_at":"2015-06-01T15:24:31Z","closed_at":"2015-06-01T14:49:47Z","pull_request":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/pulls/118","html_url":"https://github.com/ansible/ansible-modules-extras/pull/118","diff_url":"https://github.com/ansible/ansible-modules-extras/pull/118.diff","patch_url":"https://github.com/ansible/ansible-modules-extras/pull/118.patch"},"body":"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`.\r\n\r\nI 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.\r\n\r\nI 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.\r\n\r\nThe API changes are as follows:\r\n- base changed from: `https://api.hipchat.com/v1` to `https://api.hipchat.com/v2`\r\n- path changed from: `rooms/message` to `room/id_or_name/notification`\r\n- method changed from `POST` or `GET` to `POST` only\r\n- `room_id` is no longer a parameter since it is defined in the path\r\n- `from` is no longer a parameter. This is now the user who owns the token, or the notification label setup with the token.\r\n- `format` is no longer a parameter (not to be confused with `message_format`, which is still valid\r\n\r\nV1: https://www.hipchat.com/docs/api/method/rooms/message\r\nV2: https://www.hipchat.com/docs/apiv2/method/send_room_notification"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/comments/107580682","html_url":"https://github.com/ansible/ansible-modules-extras/pull/118#issuecomment-107580682","issue_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/118","id":107580682,"user":{"login":"shirou","id":177213,"avatar_url":"https://avatars.githubusercontent.com/u/177213?v=3","gravatar_id":"","url":"https://api.github.com/users/shirou","html_url":"https://github.com/shirou","followers_url":"https://api.github.com/users/shirou/followers","following_url":"https://api.github.com/users/shirou/following{/other_user}","gists_url":"https://api.github.com/users/shirou/gists{/gist_id}","starred_url":"https://api.github.com/users/shirou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shirou/subscriptions","organizations_url":"https://api.github.com/users/shirou/orgs","repos_url":"https://api.github.com/users/shirou/repos","events_url":"https://api.github.com/users/shirou/events{/privacy}","received_events_url":"https://api.github.com/users/shirou/received_events","type":"User","site_admin":false},"created_at":"2015-06-01T15:24:31Z","updated_at":"2015-06-01T15:24:31Z","body":"Sorry, I had not noticed this PR. Unfortunately, I don't use hipchat right now. So if someone make any enhancement about hipchat module, feel free to merge. Thanks!"}}