API gives 302 and if I -L curl to follow, it ends up on 404 not found

I am on the free plan trying out circleCI and testing locally and I run this command

curl -v -s -u mytoken: https://circleci.com/api/v1.1/project/github/deanorderly/orderly/

< HTTP/1.1 302 Found
< Date: Mon, 06 Apr 2020 13:30:02 GMT
< Location: https://circleci.com/api/v1.1/project/github/deanorderly/orderly
< Server: nginx

If I add -L in curl to follow the 302 redirect, then I get back 404 not found. Any idea what is going on?

thanks,
Dean

Hi @deanorderly - can you confirm whether the project in question has been set up on our end? If not, this is expected behaviour, since we don’t have your project on our end :slight_smile: If so, is there a typo on the project name?

@gmemstr I somehow missed your response. We have been running the orderly github project for a while in circle CI. I put the link in the browser and it gets back a response from github through the circle CI(I just noticed this). ie. the 404 response is github message as follows even though I hit a circleCI url

{
“message” : "{"message":"Not Found","documentation_url":"https://developer.github.com/v3/repos/#get\“}”

I also recently posted this but realizing it is very similar

For some reason, my user name is NOT my github deanorderly so fixing the username got me a step further in that now the api lists my artifacts in json which is a step forward.

I am receiving 400 Bad Request on the url above. Ironically, I get bad request whether my token is bad or not. I don’t even get a 403…how is that possible? Seems like a totally broken experience. I don’t see a header for an error reason like some apis have either like google’s.

Any ideas?

I also tried this but just get 404…

curl -i https://circleci.com/api/v1.1/project/github/deanorderly/orderly/523/artifacts?circle-token=$CIRCLE_TOKEN2

I finally got v1.1 to work but v2 still doesn’t work for some reason!!! In v1.1, the username is NOT your github username even though that seems to be my circleCI login…go figure. Instead, this worked

curl -i “https://circleci.com/api/v1.1/project/github/OrderlyHealth/orderly/523/artifacts?circle-token=$CIRCLE_TOKEN2

Why is OrderlyHealth my username? I have no idea as that is the github org. Then in v2, there is no place in the url to set that username so I have no idea why the v2 api is not working.