Q) does this api return private projects as well with public projects ?
Here, i am using the token, and i just want to fetch my org. public + private projects
Q) does this api (or all documented api) work same on all cloud based & self managed plans ?
Q) currently, i am using cloud based free plan: so my base url for all api is “https://sonarcloud.io”
ex: https://sonarcloud.io/api/components/search_project
so will this base url will be same in all the all cloud based & self managed plans or will they be different in some planes or self managed plans ?
Q) does this api return private projects as well with public projects ?
It will return both, but only those projects where the user token has browse permissions.
Q) does this api (or all documented api) work same on all cloud based & self managed plans ?
No. Requests to SonarCloud API sometimes add new parameters for the organization key.
so will this base url will be same in all the all cloud based & self managed plans or will they be different in some planes or self managed plans ?
No, on Cloud based plans the base url will be “https://sonarcloud.io” meanwhile on self managed plans it will be “https://yoursonardomain”. On both cases the endpoint will be the same, just add it to the base URL:
RE: It will return both, but only those projects where the user token has browse permissions.
How & where can i check that my token is allowed to fetched these projects or not, I am a admin, and the token i created with admin account, so won’t i get the all public + private projects fetch permission by-default ?
RE: No. Requests to SonarCloud API sometimes add new parameters for the organization key.
I assume, that the all api payload will be same, and on response there will only be some fields addition not deletion, am i correct ?
mainly i am using these below apis
/api/components/search_projects
/api/measures/search_history
How & where can i check that my token is allowed to fetched these projects or not, I am a admin, and the token i created with admin account, so won’t i get the all public + private projects fetch permission by-default ?
Even if you are admin you might not have “browse” permission on all projects.
I assume, that the all api payload will be same, and on response there will only be some fields addition not deletion, am i correct ?
As far as I know the request will be different and it will fail (not in all endpoints) if you don’t provide the organization key param for SonarCloud, and it will fail (not in all endpoints) if you provide the organization parameter for SonarQube. You must check the base url to build the request with the right parameters.
Responses will be more or less the same, maybe with additional fields for organization when requesting to SonarCloud.