Curling raw file fails

as I documented here: curling for a raw document fails. in my view this is a bug but my issue got closed without argument and I was directed here

can anyone help?

Hello @ekkis, welcome to forum.

Can you try with url api?

curl … -o test.tar.gz

if I interpret you correctly I need curl -L --header "PRIVATE-TOKEN: UhGRPnvnEryPc499SQNZ" but that fails with a 404

can you provide me with the exact command I should execute? the url I use with the browser to pull what I need is:

Hi @ekkis and welcome to the forum.

If you’re curling a single raw file from a private repository via the API, you’ll need the project ID.

You can get this easily by viewing the project page:
**image **

To make your existing command work, replace the [VARIABLES] and it should work:

curl --header "PRIVATE-TOKEN: [PRIVATE_TOKEN]"[PROJECT#]/repository/files/[RELATIVE_FILEPATH]/raw?ref=master

To download the file, you’ll need to add an additional -o [FILENAME] to the end of the curl command.

For example, to download a file from the root directory a private repository with a Project # of 11:

curl --header "PRIVATE-TOKEN: [PRIVATE_TOKEN]" -o

All the best,


thanks Greg. your solutions works though I must say the experience leaves much to be desired vis-à-vis Github where I can take the same url as in my browser and hand it to curl

from an automation perspective I now need to figure out how to get the project ID and really why should I have to bother? I should be able to just use the project name. who the hell designs this stuff?

1 Like

Yeah this really slows down builds and it makes debugging a huge issue