We are using SonarQube Community Edition - Version 8.9.7 and trying to generate a custom report for all the projects which are running on it.
We have tried to use a couple of APIs but got 401 error while trying APIs from the Postman tool.
For authentication, we have used Admin user token and project keys as well.
Please help us with the correct APIs which we can use to achieve this.
I am from the same team as Amol Khanorkar.
We are using SonarQube Community Edition - Version 8.9.7 and trying to generate a custom report for all the projects which are running on it.
We have followed the steps mentioned in the documents and we are now able to get some basic response on the Postman Tool.
Our primary purpose is to get the Quality Gates details, the last execution results, and the analysis data.
But we are unable to get the details which we are looking for. We have used Sonar user token and project keys as well.
Please help us with the correct APIs which we can use to achieve this.
If you’re primarily interested in the QG status & details, then a webhook may fit the bill without further effort.
If you really want more detail, then you’ll need to pull it with the APIs. And the best way to master the API is to perform the desired action via the UI and eavesdrop to see which calls the UI made to accomplish the action.
Regarding your API call, it’s difficult to know what’s missing. I would pare this down to basics. Start with just https://[sonarhost]/api/project_analyses/search?project=[projectKey] to get all analyses on the main branch. If that doesn’t work, the project key is wrong. If it does, add in the next parameter & debug it…