Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

Jim McClendon August 2, 2016

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
Atlassian Team members are employees working across the company in a wide variety of roles.
August 4, 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
Atlassian Team members are employees working across the company in a wide variety of roles.
August 7, 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
AUG Leaders

Atlassian Community Events