Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
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

How to download a repository for a commit using rest api 2.0 via jwt/access token

I have an app, using which i am generating an access token/ jwt token i wanted to know thw API for which i can download repository by

1. Commit id

2. branch 

 

Please suggest

1 answer

1 accepted

0 votes
Answer accepted
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Feb 23, 2023

Hello @dev works ,

Welcome to the community!

You can use the below endpoint to download a repository .zip file at a specific commit or branch : 

https://bitbucket.org/<workspace slug>/<repo slug>/get/<commit hash or branch name>.zip

Following are two examples using curl and providing the authentication headers as a Bearer token:

  • For branch : 
curl --request GET \

  --url 'https://bitbucket.org/<workspace slug>/<repo slug>/get/master.zip' \

  --header 'Authorization: Bearer <access token>'
  • For commit hash : 
curl --request GET \

  --url 'https://bitbucket.org/<workspace slug>/<repo slug>/get/<commit hash>.zip' \

  --header 'Authorization: Bearer <access token>'

Hope that helps! Let me know if you have any other questions.

Thank you, @dev works !

Patrik S 

This is working thank you 

@Patrik S Does this API work with Repository token as well ? currently it is not working for me

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Feb 28, 2023

Hello @dev works ,

Unfortunately, this API does not yet support using Repository Access tokens for authentication. I went ahead and created a feature request for it, which you can check in the link below:

I would suggest you to add your vote there, since this helps both developers and product managers to understand the interest. Also, make sure you add yourself as a watcher in case you want to receive first-hand updates from that ticket. Please note that all features are implemented with this policy in mind.

Currently, it's only possible to use the username and app password or OAuth access token as the credentials for authentication for that particular API endpoint.

Let me know in case you have any questions.

Thank you, @dev works !

Patrik S

Like Ivan Vulović likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events