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

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
DescriptionGet a list of lines of source code

URL

/api/sources

HTTP MethodGET
Response Formatsxml | json | txt

Security

Requires See Source Code Viewer role permission on the project

Examples

Use CaseExample Request
Get source code of "org.codehaus.sonar:sonar-plugin-api:src%2Fmain%2Fjava%2Forg%2Fsonar%2Fapi%2Fmeasures%2FCoreMetrics.java" from line 10 to 20

GET http://nemo.sonarsource.org/api/sources?resource=org.codehaus.sonar:sonar-plugin-api:src%2Fmain%2Fjava%2Forg%2Fsonar%2Fapi%2Fmeasures%2FCoreMetrics.java&from=10&to=20

...