It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

I am trying to create a room through the hipchat v2 api

I have a key and it it being sent, but I keep getting this error.  I am posting it to https://api.hipchat.com/v2/room

I am using the Cocoa Rest Client

I got the same response submitting with python.

Could there be something wrong with the endpoint?

{
 "error": {
 "code": "400",
 "message": "The request requires a properly encoded body with the 'content-type' header set to '['application/json']",
 "type": "Bad Request"
 }
}

 

 

These are the headers being sent

Accept: */*
Content-Type: application/json
Authorization: Bearer <key omitted>
Accept-Language: en-us
Accept-Encoding: gzip, deflate

This is the response header

HTTP 400 Bad Request 
Server: nginx
Content-Type: application/json
Access-Control-Expose-Headers: Date, ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Backoff
X-Ratelimit-Reset: 1470176986
Connection: keep-alive
Date: Tue, 02 Aug 2016 22:24:45 GMT
X-Ratelimit-Limit: 100
Content-Length: 186
X-Ratelimit-Remaining: 100
Access-Control-Allow-Origin: *

2 answers

1 vote
David Maye Atlassian Team Aug 04, 2016

Hi Jim,

I was encountering a similar issue using Postman, however if I run a curl statement it works perfectly fine:

my-macbook-pro:~ dmaye$ curl -d '{"name": "Api_created_room_2"}' -H 'Content-Type: application/json' 'https://<redacted>/v2/room?auth_token='<redacted>'
{"entity": {"id": 7, "is_archived": false, "links": {"participants": "https://<redacted>/v2/room/7/participant", "self": "https://<redacted>/v2/room/7", "webhooks": "https://<redacted>/v2/room/7/webhook"}, "name": "Api_created_room_2", "privacy": "public", "version": "A2NY5UK4"}, "id": 7, "links": {"self": "https://<redacted>/v2/room/7"}}

Not sure if this helps or not, but I thought it was worth mentioning.

Cheers,
-David
HipChat Server Support Engineer | Atlassian

0 votes
Anatoli Atlassian Team Aug 07, 2016

Looks like the header is set correctly. It might be body that is not encoded correctly.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Hipchat

Hipchat Cloud and Stride have reached End of Life (updated)

All good things come to an end - thanks to all our customers and partners who have been along the Hipchat and Stride journey with us.  As of Feb 15th 2019, Hipchat Cloud and Stride have reached ...

35,199 views 9 8
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you