CircleCI-Archived / api-preview-docs

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

"message" : "Project not found" #40

Open bmcgair opened 5 years ago

bmcgair commented 5 years ago

following the simple example you give on the front page.

curl -u ${CIRCLECI_TOKEN}: -X POST --header "Content-Type: application/json" -d '{ "parameters": { "param1": "foo", "param2": "find-me" } }' https://circleci.com/api/v2/project/gh/myorg/myproj/pipeline

"message" : "Project not found"

The project is found just fine by the 1.1 api This doesn't work either:

curl -u ${CIRCLECI_TOKEN} https://circleci.com/api/v2/me Enter host password for user 'mytokenhere':

I try it like this and I get the spew:

curl -u ${CIRCLECI_TOKEN}: -X POST --header "Content-Type: application/json" -d '{ "parameters": { "param1": "foo", "param2": "find-me" } }' https://circleci.com/api/v2/project/myorg/myproj/pipeline

<!DOCTYPE html>

Continuous Integration and Deployment
yaningo commented 3 years ago

Considering that the project does exist (confirmed by the successful API v1.1 request), this error message suggests that you're using project API tokens, which are not supported on CircleCI API v2, as opposed to personal API tokens.

austinflowspace commented 1 year ago

For whoever is also trying to hit the CircleCi API v2 with a project API token... As @yaningo mentioned, you will need to use a personal api token instead. Would love the ability for project level api tokens as that would be more secure and give the ability for more long-term use cases.