Extract project details with tags through API call

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension):8.9
  • what are you trying to achieve: Would like to extract all projects list including tags through API call
  • what have you tried so far to achieve this: Able to execute the API but not getting complete projects response either through postman/curl API call.

curl -X GET --user “admin:XXXXXXXXXXXXXX” -H “Accept:$ACCEPT_HEADER” -H “Content-Type:text/plain” “https://dev.sonarqube.XXX.com/api/components/search_projects?” | json_pp >> jsonoutput.json

postman: https://dev.sonarqube.XXX.com/api/components/search_projects?
using access token.

Please advise why we are getting complete project response.

Thanks,
Jagan Siram

If not a complete response, what kind of response are you getting?

I’m getting the project response with tag but out of 103 projects, I’m able to extract only 95 projects. Below is the sample of few project details.

“components” : [
{
“needIssueSync” : false,
“name” : “AST_test”,
“isFavorite” : false,
“tags” : ,
“organization” : “default-organization”,
“visibility” : “private”,
“key” : “f_el6a9InFZHv-4D4qmrcDHxwMUZ3EJfj_wMT-fbNZ_PIjuTzdoJ7Im_tKH3dwquCBvhksH_sEzPrQB10k043XBVNCcVg7JYZwayJGasu77egfUaRhZAUPp5p4swgE”,
“qualifier” : “TRK”
},
{
“name” : “blackduck-microservice3”,
“isFavorite” : false,
“needIssueSync” : false,
“tags” : ,
“organization” : “default-organization”,
“qualifier” : “TRK”,
“key” : “blackduck-microservice3”,
“visibility” : “private”
},
{
“name” : “BuildTestApp”,
“isFavorite” : false,
“needIssueSync” : false,
“tags” : ,
“organization” : “default-organization”,
“qualifier” : “TRK”,
“visibility” : “private”,
“key” : “BuildTestApp”
},

Where do you see that there should be 103 projects?

Hi Colin,

I’m able to get all 103 project details using paging index “p”. My issue is solved now.

Thank you,
Jagan

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.