Searching components of an organization returns nothing on SonarCloud

Hello,

I am trying to get all components providing organization’s name with url
https://sonarcloud.io/api/components/search?organization={organizationKey}&qualifiers=TRK

but get null in components even I know they are there…

{
“paging”: {
“pageIndex”: 1,
“pageSize”: 100,
“total”: 0
},
“components”:
}

Am I missing something? Could you please help?
Thank you!

Hello,
If your organization is paid and your project are private they won’t show up in the result of the request unless you authenticate it.

If you are not authenticated when doing the request, only the public projects of your organization will be returned.

You can do an authenticated request like this:

curl -u {yourToken}: https://sonarcloud.io/api/components/search?organization={organizationKey}&qualifiers=TRK
1 Like