Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission Denied from API #122

Open
cmontgomerymt opened this issue Oct 24, 2018 · 6 comments
Open

Permission Denied from API #122

cmontgomerymt opened this issue Oct 24, 2018 · 6 comments
Labels
enhancement New feature or request

Comments

@cmontgomerymt
Copy link

I am trying to use the endpoint specified here:
https://circleci.com/docs/api/v1-reference/#new-project-build

https://circleci.com/api/v1.1/project/:vcs-type/:username/:project/build?circle-token=:token

But get
"message" : "Permission denied"

error.
Not sure why it's denied as I have an API token in CircleCI to use. I also send data

{"branch": "staging"}

@ndintenfass
Copy link
Contributor

Is it possible you’re using a “project token” rather than a “user token”?

@cmontgomerymt
Copy link
Author

cmontgomerymt commented Oct 24, 2018

Thank you! That seemed to be it. Will the user token expire after a while?

@ndintenfass
Copy link
Contributor

No, but it seems we should probably at least make this error message better.

@ndintenfass ndintenfass added the enhancement New feature or request label Oct 29, 2018
@mryellow
Copy link

mryellow commented Mar 6, 2019

As it stands the documented approach simply does not function.

Some talk over here about using different syntax which includes -d 'build_parameters[CIRCLE_JOB]=build' header. Although similarly does not work as expected and yields errors which make no sense as the settings it says are wrong are set exactly as it describes they should be.

https://discuss.circleci.com/t/api-to-trigger-a-new-build-by-project-preview-fails/24610

Seems nowhere is it documented that a circle-token has changed from being a "project" key to a "user" key.

@maximedupre
Copy link

Indeed this should be better documented! I'm so glad I found this thread though :D

@mryellow
Copy link

You're kidding me, it had been reported 2 years ago when I first encounted it. Must be no coders working at CircleCI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants