I'm trying to download a single added asset from a release in a private repository but all I get is a 404 response. the download url of the asset is https://github.com/<user>/<repo>/releases/download/20211022/file.json
I've tried several different methods of specifying the username and private access token but all give the same result. When I use the access token to access api.github.com then it seems to work.
I've tried the following formats in curl
curl -i -u <user>:<token> <url>
curl -i "https://<user>:<token>@github.com/ ...."
curl -i -H "Authorization: token <token>" <url>
I can download the source code (zip) from the release, but this has a different url: https://github.com/<user>/<repo>/archive/refs/tags/20211022.zip
What am I doing wrong?