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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,555,948
Community Members
 
Community Events
184
Community Groups

Personal Access Token

Andrea Pannitti
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 25, 2022

Hi all,
I was able to create a bitbucket project by REST API, using the following:

/rest/api/1.0/projects [POST]

With the following body:

{"key": "TEST", "name": "TestProject", "description": "Test"}

And using the Basic Authentication.

Now, I create a Personal Access Token for a Bitbucket user admin and I'm trying to call the same REST api to create another project using the Personal Access Token but in this case I receive an error 401 Unauthorized: You are not permitted to access this resource.

How could I solve this problem?

Thanks

2 answers

1 accepted

0 votes
Answer accepted
Andrea Pannitti
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 27, 2022

The problem is due to the fact that with token authentication it is possible to:

Create and fork repositories
Update project settings and permissions
Update repository settings and permissions
Push to repositories and perform pull request actions
Pull and clone repositories

But not to create projects.

Hi

Can you test a GET request? the token should be used in the same place the password was together with the username.

For ex. in curl it should look like this:

 

curl -s --user <userID>:<TOKEN> --request GET https://URL/rest/api/latest/projects?limit=10
Andrea Pannitti
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 26, 2022

Hi @Idan Bidani ,

no, I need to call in POST because I must create a new Project on Bitbucket and I want use the Personal Access Token because more secure of the Basic Authentication.

 

Regards

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events