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 5 Next »

DescriptionGet a list of lines of source code

URL

/api/sources

HTTP MethodGET
Response Formatsxml | json | txt

Security

Requires User role on the project

Examples

Use CaseExample Request
Get source code of 'org.codehaus.sonar:sonar-plugin-api:org.sonar.api.measures.CoreMetrics' from line 10 to 20

GET http://nemo.sonarsource.org/api/sources?resource=org.codehaus.sonar:sonar-plugin-api:org.sonar.api.measures.CoreMetrics&from=10&to=20

Response Format

JSON

Parameters

Parameter

Description

Required

Default ValueExample Value

resource

id or key of the resource

Yes

Noneorg.codehaus.sonar:sonar

from

First line to display

No

None10

to

Last line to display (inclusive)

No

None20

color

Highlights code syntax if true.
Possible values: true | false 

No

falsetrue
formatResponse formats: xml or json or txtNoNonejson
  • No labels