Quality gate status on Sonarcloud with private repos


I was using public repo and could do a :

curl -sL https://sonarcloud.io/api/qualitygates/project_status?projectKey=abcd


But with a private repo I am not able to do that.
I tried with
curl -L -v -u mustafa.turabali:P****** https://sonarcloud.io/api/qualitygates/project_status?projectKey=abcd

but not working , can you please help.

Julien Lancelot
can you assist?


Please do not directly mention people. You won’t’ receive an answer faster by doing so.

As mentioned in the documentation, you have to create a token and use it as a replacement for your login in basic auth.
So it would be:
curl -L -v -u <your-token>: https://....


I’m using your curl command with a token and still having problems:

curl -L -v -u myToken: https://sonarcloud.io/api/qualitygates/project_status?projectKey=myProjectKey

I get the following

{"errors":[{"msg":"Component key 'myProjectKey' not found"}]}

You’ll need to define your organization as a query parameter as well.

Thanks. Looks like the docs need updating. That param isn’t listed. https://sonarcloud.io/web_api/api/qualitygates/project_status

Thanks for the heads up. I’ll ping around :slight_smile: