We are trying to fetch the license details of our Bitbucket product through API calls using Personal Access tokens.
we are getting 401 Unauthorized access error.Please find the error details.
The remote server returned an error: (401) Unauthorized.
API Used: https://bitbuckethosturl/rest/api/1.0/admin/license
I have created the token for an admin account.we are able to view the license details in the UI but when tried through API we are getting above exception.
Please let us know how we can fix this authentication issue. Let me know if anything i need to change in my settings.
Awaiting for your reply.
My experience with Bitbucket REST API is that personal access tokens cannot be used with administrator related REST endpoints.
I am not sure why.
So, for admin related REST endpoints basic auth may be the way to go but not ideal. I would prefer personal access tokens over basic auth.
curl -v -X GET -u admin-username:password https://bitbuckethosturl/rest/api/1.0/admin/license
Response HTTP 200 with license info.
Personal access token:
curl -v -X GET -H "Authorization: Bearer MTQ1NTY0MDA4OTEwOtAOXXXXXXXXX" https://bitbuckethosturl/rest/api/1.0/admin/license
Response HTTP 401
Hey everyone, over the past year, we've added several new features on how you can use Bitbucket and Jira together. We'd love to know how you'll are using the integration and how it's helping your t...
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