Using the repo archive API


#1

I’m trying to figure out the correct API call to download an archive.

I’m using gogs 0.11.79.1211 on centos7 with mariadb10.

I’ve tried a number of variations, lates is something like:

curl -v -H “Authorization: token $GOGS_TOKEN” ‘https://gogsurl.com/api/v1/repos/joe/sites/reponame/archive/master.tgz

I’m getting 404s so far for everything. Search works so I know my token it’s coming through OK.


#2

Found the errors.

curl -v -H “Authorization: token $GOGS_TOKEN” ‘https://gogsurl.com/api/v1/repos/sites/reponame/archive/master.tar.gz’

The username was incorrectly included, it needed the repo owner only. Also it’s tar.gz - not tgz.