Skip to end of metadata
Go to start of metadata

Table of Contents

Get a List of Favorites

DescriptionGet the logged in user's list of favorites

URL

/api/favourites

HTTP MethodGET
Response Formatsjson | xml

Security

Authentication required

Examples

Use CaseExample Request
Get the logged in user's list of favorites

GET http://localhost:9000/api/favourites

Parameters

Parameter

Description

Required

Default ValueExample Value
format

Response format can be set through:

  • Parameter format: xml | json
  • Or the 'Accept' property in the HTTP header:
    • Accept:text/xml
    • Accept:application/json
If nothing is set, json is used.
NoNonejson

Create a Favorite

 

DescriptionCreate a favorite

URL

/api/favourites

HTTP MethodPOST

Security

Authentication required

Examples

Use CaseExample Request
Create a favorite on project org.codehaus.sonar:sonar for the user admin/admin

curl -u admin:admin -d "key=org.codehaus.sonar:sonar" http://localhost:9000/api/favourites

Parameters

Parameter

Description

Required

Default Value

Example Value

key

id or key of the component

Yes

None

org.codehaus.sonar:sonar

Delete a Favorite

 

DescriptionDelete a favorite

URL

/api/favourites/:key

HTTP MethodDELETE

Security

Authentication required

Examples

Use CaseExample Request
Delete the favorite flag on project org.codehaus.sonar:sonar for the user admin/admin

curl -u admin:admin -X DELETE http://localhost:9000/api/favourites/org.codehaus.sonar:sonar

 

Parameters

Parameter

Description

Required

Default Value

Example Value

key

id or key of the component

Yes

None 
  • No labels