This section explains the following REST operations regarding the rating of resource which have been secured with Basic Auth.
The following terms explain the meaning of the parameters passed with the following REST URIs
Parameter | Explanation |
---|---|
path | Path of the resource |
value | User's rating on the given resource. It varies in range from 1-5. |
user | Username of the user |
Get the Rating of a Resource
Attributes | Values |
---|---|
HTTP Method | GET |
Request URI | /rating?path={ resource path } |
HTTP Request Header | Authorization: Basic { base64encoded(username:password) } |
Description | It retrieves the current overall rating and the user rating of the requested resource. |
Response | HTTP 200 OK |
Response Type | JSON |
Add a Rating to a Resource
Attributes | Values |
---|---|
HTTP Method | POST |
Request URI | /rate?path={ resource path }&value={ your rating } |
HTTP Request Header | Authorization: Basic { base64encoded(username:password) } |
Description | It adds the user's rating for the requested resource. The rating can vary between 0 and 5. |
Response | HTTP 204 No Content |
Response Type | JSON |
Delete the User-specific Rating of a Resource
Attributes | Values |
---|---|
HTTP Method | DELETE |
Request URI | /rate?path={ resource path } |
HTTP Request Header | Authorization: Basic { base64encoded(username:password) } |
Description | It deletes the user-specific rating for the requested resource. |
Response | HTTP 204 No Content |
Response Type | JSON |