Full documentation for SonarQube has moved to a new location: http://docs.sonarqube.org/display/SONAR

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 21 Next »

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
  • get a list of violations on a given resource
  • get all the violations of a project
  • get the blocker and critical violations of a project
/api/violations
Reviews
  • get a list of reviews
  • create a review
  • update a review (add comment, reassign it, etc.)
/api/reviews

Resources and Measures

Domain

Examples of use cases that can be fulfilled

Web Service
Measures, Resources
  • get a list of resources
  • get the measures of a list of metrics on a given resource
/api/resources
Manual Measures
  • get a list of manual measures
  • create a manual measure
  • delete a manual measure
/api/manual_measures
Time Machine
  • get past measures
/api/timemachine
Metrics
  • get a list of metrics
  • create a metric
  • update a metric
  • delete a metric
/api/metrics
Sources
  • get a list of lines from source files
/api/sources

Administration

Domain

Examples of use cases that can be fulfilled

Web Service
Quality Profiles
  • get the list of coding rules activated in a quality profile
  • backup a quality profile
  • restore a quality profile
/api/profiles
Rules
  • get a list of rules
/api/rules
Properties
  • get a list of properties
  • create a property
  • update a property
  • delete a property
/api/properties
User Properties
  • get a list of user properties
  • create a user property
  • update a user property
  • delete a user property
/api/user_properties
Project Settings
  • delete a project
/api/projects
Security
  • authenticate
/sessions/login
Server
  • get the status of the Sonar server
  • upgrade the Sonar database
  • get the system properties, server info (Java, OS), database configuration, JVM statistics and installed plugins
/api/server
Update Center
  • get the list of all the plugins installed on the Sonar instance
/api/updatecenter/installed_plugins
Events
  • get a list of events from a project
  • get a list of global events
  • create an event
/api/events
Favourites
  • get the logged in user's list of favourites
  • create a favourite
  • delete a favourite
/api/favourites

Simple MS Excel Samples

  1. Extracting a list of Measures of a Project: download the MS Excel sample

  2. Extracting all the Violations of a Project: download the MS Excel sample

Authentication

Icon

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 proper web service documentation to get the list of available format responses.

HTTP Status Codes

HTTP Code

Description

200

OK

400

Bad request.
The request could not be understood by the server due to malformed syntax.

401

Unauthorized

403

Forbidden.
The request was a legal request, but the server is refusing to respond to it.

404

The requested resource could not be found.

500

Internal server error.

  • No labels