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

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


1 badge earned


Participate in fun challenges

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


Gift kudos to your peers

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


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!


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
Community Members
Community Events
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" -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


--2022-12-14 15:30:30--
Resolving (, 2406:da00:ff00::22e9:9f55, 2406:da00:ff00::22c0:3470, ...
Connecting to (||:443... connected.
HTTP request sent, awaiting response... 401 Unauthorized

Username/Password Authentication Failed.


wget --header 'Authorization: Bearer access_token'


--2022-12-14 15:31:32--
Resolving (, 2406:da00:ff00::22c5:2ef4, 2406:da00:ff00::6b17:d1f5, ...
Connecting to (||:443... connected.
HTTP request sent, awaiting response... 401 Unauthorized


this work

git clone


please solve this problem access_token on raw not work

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events