Web APIs with Postman error

I am trying to retrieve the project analyses information from a sonarqube project but i’m not sure how i can use the API with postman. The output i get is not the same as the response example given in the docs, but instead it is the html page of the sonarqube home page. Please let me know how to fix this. Please find the below attached image to see what i am trying.

The response example expected:

Hey there.

It looks like you’re calling our marketing website (https://www.sonarqube.com/) instead of the actual URL of your SonarQube instance (the one you use when you access SonarQube).

You can see a real life example returned by your browser here: https://next.sonarqube.com/sonarqube/api/project_analyses/search?project=org.sonarsource.scanner.vsts%3Asonar-scanner-vsts

Hi Colin,

I have tried this as well and I dont receive any response.

I would suggest working in your browser first, and then trying to replicate the calls in Postman.

Hi Colin,

Thank you for your response. Since I am fairly new to working with APIs, could you let me know how I should go about working with sonarqube APIs on the browser? For Example, trying the project_analyses/search api on any of the following project?

The following link doesn’t give me any result:
https://www.sonarqube.gwsweb.net/api/project_analyses/search?project=wmstest

It’s a good place to start.

What does it return?

The single responsibility of the SonarQube UI is to make calls to the Web API and display the data. For example: if you browse to the Activity tab of any project, you are viewing the results of GET api/project_analyses/search.

Your browser dev tools might help you:

Hi Colin,

Thank you so much for your help! My browser dev tools did help out and I can now progress with my project. I will learn more about this using my browser and will move to Postman later on.

2 Likes

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