api v2 username doesn't work
marksterxxx opened this issue · comments
Good day, I'd like to know if username cannot be set in api v2
client = HipChat::Client.new(api_tokenv1)
client['my room'].send('stranger', 'I talk') #user is displayed as stranger
client = HipChat::Client.new(api_tokenv2, :api_version => 'v2')
client['my room'].send('stranger', 'I talk') #user is always my username
I too have this issue :(
I think they (Hipchat) have dropped the ability to arbitrarily set the "from" username in their v2 api. If you look at their room notification api docs there's no mention of it (https://www.hipchat.com/docs/apiv2/method/send_room_notification)
You can create individual Room Notification authentication tokens and any notifications sent with this token will appear as being from the name you give the token... but it's still not ideal for automated scripts and bots.
You can still create a v1 API token and use the v1 API if you want to set the from field... but presumably it's days are numbered.
@marksterxxx closing?
@vrybas yes.
I just noticed that
http://api.hipchat.com/v2/room/room_name/notification?auth_token=token_with_label_stranger
sets the from to the token label (stranger).
so creating different tokens with different labels would be a workaround.