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

Personal Access Token returning error when used from a REST API

sukarnar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 19, 2019

I have created a TOKEN_NAME  as PG_REQ in bitbucket.

When I pass the token name in the header of my PLSQL API I get this error.

 

The token permissions are  read only.

 

{"errors":[{"context":null,"message":"You are not permitted to access this resource","exceptionName":"com.atlassian.bitbucket.AuthorisationException"}]}

 

Should the header value pass a token name PG_REQ before invoking REST API. ?

 

My basic authentication work when I pass user name and password.

 

Thanks

Sukarna

1 answer

1 accepted

0 votes
Answer accepted
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 20, 2019

Hello Sukarna and welcome to the Community!

Thank you for providing the steps you took to create your token along with the error message you’re receiving when attempting to use said token.

Upon review, it looks as though you may have created your token with only read access on the repository. This would explain why you’re able to use your basic authentication without issue but are presented with an error upon using your newly created token.

We would suggest creating a new token which has the level of access you may need. Your levels may be one of the following read/write/admin.

More about the level of permissions with your API token may be found at Personal access tokens.

Please let us know if a new token with the required level of permissions works for your needs.

Regards,
Stephen Sifers

sukarnar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 21, 2019

Thank you for your reply Stephen. 

I have resolved this issue by passing header  Authorization: Bearer   XXXXXXXXXXX

Earlier I could not figure out what header parameters should be used for token based access to invoke REST API's. 

Thanks

Sukarna

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events