Test Token not working and what happend to my personal token?

hipchat
auth

#1

So Ive followed https://developer.atlassian.com/hipchat/guide/hipchat-rest-api/api-access-tokens and gotten my add-on a token, which Im storing in my DB. Im trying to test the token to se if its still valid with the method described here https://developer.atlassian.com/hipchat/guide/hipchat-rest-api - Testing a token: GET /v2/room?auth_token=YOUR_TOKEN&auth_test=true HTTP/1.1.

So Im doing curl 'https://api.hipchat.com/v2/room?auth_token=<my token>&auth_test=true';

and Im getting back:

  "error": {
    "code": 403,
    "message": "Only requests matching one of these authenticated principals are allowed to access this resource: an active user, a global add-on",
    "type": "Forbidden"
  }

When I get this token, Im giving it the following scopes: 'grant_type=client_credentials&scope=send_notification+admin_room+view_room+view_group+view_messages' so Im not sure why this is happening. I would like to test the token to find out if its still valid. I know the page says that link will return the scopes, but Im assuming it will return some sort of other data if its expired. Im looking for that data.

In turn, I noticed that as soon as I made the above <my token> that my user token was no longer in the API section of my account settings. I ended up having to just create a new one, but I did try this first, with grant type ‘personal’:

curl 'https://api.hipchat.com/v2/oauth/token' \
    -H 'Content-Type: application/x-www-form-urlencoded' \
    -u <my oauthId:myoauthSecret \
    --data 'grant_type=personal&scope=send_notification+admin_room+view_room+view_group+view_messages';'

This came back :

{
  "error": "invalid_request",
  "error_description": "The value cannot be empty"
} 

But there were no empty values.

So my questions are with this:

  1. Why did my user token that Ive been using for weeks disapear from my account?
  2. how can I create a personal token programatically.

The reason for this is that our addon needs to send a PM to a specified user at the end of something we post in the room. So using my personal token, all those PMs look like they are from me. We want it to come from the add-on or a ‘robot’ user, lets call him @SupportGuy, so I want to create a user named “Support Guy” and use his token to msg the particular user.

Any answers will help, thanks!