I was receiving a 401 until I started messing with the api parameter and couldn’t find a combination that wouldn’t give a 404 and I believe that’s due to the fact that the hipchat module is passing in the message in the wrong spot.
Can anyone verify?
My intended usage is to use a hipchat notification API token passed in to notify of play completion.
According to this: https://www.hipchat.com/docs/api, the v2 API is still in beta, so there should not be any issues with the module as it stands. A 401 indicates an authorization issue, not a target URL problem, so I would double check your API token and username.
I will work on it more today but you could receive a 401 if you were using a notification API token that is assigned to a particular room and you were trying to use it to authenticate anywhere else that was a valid URL. My main concern was how the URL string got assembled by the module parameters.
I was more interested in whether anyone actually had any experience using the module with the v2 API of hipchat.
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:
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.