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

Getting 401 when trying to create a user using HipChat API v2

Daniel Batalla October 23, 2015

Hi, I'am trying to create a user using HipChat API v2, but I always get 401 code error. I created a personal access token with my admin user but that does not work. How can I get/create that token that I must use in order to create a user?

NOTE: The token created has admin_group scope. This should let me create users.

Here is a cURL example of my Error, using auth_test param:

 

curl --header "content-type: application/json" --header "Authorization: Bearer YOUR_TOKEN" -X POST https://api.hipchat.com/v2/user?auth_token=MY_TOKEN&auth_test=true

[1] 14700

MBP-de-Daniel:pr_project zpricing$ {

  "error": {

    "code": 401,

    "message": "Invalid OAuth session",

    "type": "Unauthorized"

  }

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Nágila Marques
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 26, 2015

Hey, Daniel!

From your description, it looks like you're using an APIv1 token on an APIv2 request, and that won't work. Note that we have two different versions of the API (v1 and v2), and the documentation can be a bit confusing about that. Here's how to get APIv2 tokens - https://www.hipchat.com/docs/apiv2/auth 



Hope it helps. 

Kind regards,
Nágila Marques
HipChat Support
0 votes
Akhil Dani May 11, 2017

Hi, I am new in creating HipChat API.

I want to integrate HipChat with Jenkins. I am trying from last few days with different techniques and failing everytime.

In jenkins Global Hipchat notifier Setting is showing this message

"Test Notification Failed:
Unexpected response code from HipChat: 401"

Could you please guide me how to integrate the HipChat with Jenkins?

Thanks and Regards,

Akhil

 

 

0 votes
Daniel Batalla October 26, 2015

Hi Nagila!

Thanks for the answer. I finally could fix the problem, I had a misspelling in auth_token header.

Sorry for the dumb question. 

TAGS
AUG Leaders

Atlassian Community Events