| Table of Contents |
This page lists all the available Web Services to be used by any HTTP clients.
Available Web Services
Violations and Reviews
| Domain | Examples of use cases that can be fulfilled | Web Service |
|---|---|---|
| Violations |
| /api/violations |
| Reviews |
| /api/reviews |
| Rules |
| /api/rules |
| Quality Profiles |
| /api/profiles |
Projects and Measures
| Domain | Examples of use cases that can be fulfilled | Web Service |
|---|---|---|
| Measures, Resources |
| /api/resources |
| Manual Measures |
| /api/manual_measures |
| Metrics |
| /api/metrics |
| Time Machine |
| /api/timemachine |
| Sources |
| /api/sources |
| Events |
| /api/events |
User
| Domain | Examples of use cases that can be fulfilled | Web Service |
|---|---|---|
| User Properties |
| /api/user_properties |
| Favourites |
| /api/favourites |
Administration
| Domain | Examples of use cases that can be fulfilled | Web Service |
|---|---|---|
| Project Settings |
| /api/projects |
| Properties |
| /api/properties |
| Server |
| /api/server |
| Update Center |
| /api/updatecenter/installed_plugins |
Simple MS Excel Samples
Extracting a list of Measures of a Project: download the MS Excel sample
Extracting all the Violations of a Project: download the MS Excel sample
| Authentication In case your Sonar server is secured, you will also have to manage authentication. Here's an MS Excel sample to deal with it. |
Response Formats
The API provides several response formats such as XML, JSON (ie. JavaScript Object Notation) plain text or CSV.
Check the available formats on the page of each web service.
HTTP Status Codes
HTTP Code | Description |
|---|---|
200 | OK |
400 | Bad request. |
401 | Unauthorized |
403 | Forbidden. |
404 | The requested resource could not be found. |
500 | Internal server error. |
Authentication
URL | /sessions/login |
| HTTP Method | GET |
Security | None |
Examples
Use Case | Example Request |
|---|---|
Authenticate on http://localhost:9000 with user admin (password = admin) |
?Q? |
Basic HTTP authentication is also supported. Example with curl to create an event |
|
Parameters
Parameter | Description | Required | Default Value |
|---|---|---|---|
login | User login | Yes | None |
password | User password | Yes | None |

