Created
January 27, 2016 21:55
-
-
Save aspyker/6760310d5061a8beb5a2 to your computer and use it in GitHub Desktop.
Updating Hipchat's room avatars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Note: I wasn't (yet) able to get this to work, but adding here so maybe someone else gets further: | |
- get your host name for the API .. something like COMPANYNAME.hipchat.com | |
- create an oauth token for your user through the hipchat web UI, lets say it is OAUTHKEY with all permissions | |
- find an image you want to use for your room avatar and get the base64 encoded version using a tool like: | |
https://www.base64-image.de/ | |
- save the image to with the below contents, let's say as avatar.json: | |
{ "avatar" : "base64encodinghere" } | |
- curl -v http://COMPANYNAME.hipchat.com/v2/room/ROOMNAME?auth_token=OAUTHKEY" | |
- you should get a json file that is the description of the room currently, and it shouldn't have a avatar_url field | |
- curl -v -H "Content-Type: application/json" -X PUT --data @avatar.json "http://COMPANYNAME.hipchat.com/v2/room/ROOMNAME/avatar?auth_token=OAUTHKEY" | |
- you should get a 204 response | |
- curl -v http://COMPANYNAME.hipchat.com/v2/room/ROOMNAME?auth_token=OAUTHKEY" | |
- you should now see a avatar_url": "uploads.hipchat.com/photos/room_XXXXX/XXXXXX.png" | |
Now, if you look at that url, the image does exist. However, neither the web client nor macos client shows it in the UI. |
I managed to get this working by executing the following:
curl -v -H "Content-Type: application/json" -X PUT -d '{ "avatar": "BASE64 Encoded Image here" }' http://SERVER_NAME_HERE.hipchat.com/v2/room/ROOM_NAME_HERE/avatar?auth_token=AUTH_TOKEN_HERE
I can verify that the image is there using GET /avatar (it returns a URL on amazon S3), but still, the image doesnt show up in the app (web, or desktop). Seems rather pointless.
I'm having the same issue as @andrewleith. I've confirmed the upload worked, but it doesn't appear anywhere.
Same here, upload (and rescaling by server) succeeds, but UIs (webapp, MacOS) do not display it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Seems that we have to provide that
descriptor
, it gives me the following error (But seems near to be done!):Note that I'm using
curl
with Window's PowerShell, maybe under Linux works 💻How nice would be to change Hipchat room's avatar. 💥 🌝