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,464,971
Community Members
 
Community Events
176
Community Groups

How to download a raw file from BitBucket repository using Token ? (BitBucket version is v4.3.2).

I could download the files but only as json using the below command:

curl -L -O -G -H "X-Auth-User:userName" -H "X-Auth-Token:userToken" http://xx.xxx.xxx.xxx:7990/rest/api/1.0/projects/DOC/repos/xxx/browse/Jenkinsfile -d at=refs/heads/jenkinsfile -d raw

 

X-Auth-Token provided in the above URL is obtained from Token authentication plugin .

But my aim is

1. To download raw file using above format (not in json format)

2. To have a service account and require a common token for it and download the raw file from a repo

Any help would be appreciated!

2 answers

1 vote

You could try:

 curl -X GET -H "Authorization: Bearer $PAC" https://xxxxxxx:7990/rest/api/latest/projects/DOC/repos/xxx/raw/Jenkinsfile

assuming the file you want is: Jenkinsfile and $PAC is your authorization token

Thanks John.

 

I'm able to access it with PAC in BitBucket version 5.7. But in v4.3.2 PAC option is not available.

Tried using Token authentication x-token-auth but it downloads the file in json format.

I want to use this x-token-auth and download the raw file instead.

yes raw not work please solve

 

wget --user=x-token-auth --password=access_token --auth-no-challenge https://bitbucket.org/andykimpe/euroiptv-epg-fr/raw/master/config/France/TF1/TF1.xml

 

--2022-12-14 15:30:30-- https://bitbucket.org/andykimpe/euroiptv-epg-fr/raw/master/config/France/TF1/TF1.xml
Resolving bitbucket.org (bitbucket.org)... 104.192.141.1, 2406:da00:ff00::22e9:9f55, 2406:da00:ff00::22c0:3470, ...
Connecting to bitbucket.org (bitbucket.org)|104.192.141.1|:443... connected.
HTTP request sent, awaiting response... 401 Unauthorized

Username/Password Authentication Failed.

 

wget --header 'Authorization: Bearer access_token' https://bitbucket.org/andykimpe/euroiptv-epg-fr/raw/master/config/France/TF1/TF1.xml

 

--2022-12-14 15:31:32-- https://bitbucket.org/andykimpe/euroiptv-epg-fr/raw/master/config/France/TF1/TF1.xml
Resolving bitbucket.org (bitbucket.org)... 104.192.141.1, 2406:da00:ff00::22c5:2ef4, 2406:da00:ff00::6b17:d1f5, ...
Connecting to bitbucket.org (bitbucket.org)|104.192.141.1|:443... connected.
HTTP request sent, awaiting response... 401 Unauthorized

 

this work

git clone https://x-token-auth:access_token@bitbucket.org/andykimpe/euroiptv-epg-fr.git

 

please solve this problem access_token on raw not work

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events