CircleCI-Archived / api-preview-docs

In-progress docs about the pre-release preview of CircleCI API v2
72 stars 26 forks source link

Bug: New /project/project-slug/pipeline getting 404 #44

Open eddiewebb opened 5 years ago

eddiewebb commented 5 years ago

What is the Problem?

I am seeing 404 "project not found" messages on new API endpoint

What was expected behavior?

I expected a 200/202 and listing of recent pipelines

Can you recreate it?

Yes. Using the API url in these docs, or the generated openAPI schema |

Below is curl snippets that can be used.

# i can trigger pipelines (you can too if you want
curl --request POST   --url 'https://circleci.com/api/v2/project/gh%2Feddiewebb%2Fcircleci-queue/pipeline?circle-token=minenotyours'   --header 'accept: application/json'
{"number":34,"state":"pending","id":"1ca33a79-8711-40bd-999d-e4308bab1ed3","created_at":"2019-08-06T21:24:12.143Z"}

# but not list them
curl --request GET \
  --url 'https://circleci.com/api/v2/project/gh%2Feddiewebb%2Fcircleci-queue/pipeline?circle-token=minenotyours' \
  --header 'accept: application/json'
{"message":"Project not found"}

a few other v2 project APis like checkout keys work fine as well.

ilyapuchka commented 5 years ago

I have error even on POST requests: curl -u ${CIRCLECI_TOKEN}: -X POST "Content-Type: application/json" -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{}' https://circleci.com/api/v2/project/github/Babylonpartners/Stevenson/pipeline

always results in project found message. The project is configured with pipelines.

shroomist commented 4 years ago

same here, opening URL in browser does yield the build history though.

sulami commented 4 years ago

This sounds like you might have the wrong token. If you open the URL in the browser, it will authenticate using your session cookie (assuming you're logged in), which is why it works. I'd recommend double-checking the token you're supplying if you're getting 404s for projects that should be working.

shroomist commented 4 years ago

My bad, I've been trying to use Project Api token not a Personal Api Token.

airtonix commented 3 years ago

switched to using a personal token and still getting this error.

this EXACT api call was working two days ago and now for no obvious reason it fails.