Ratings¶
These endpoints allow the retrieval, creation, and modification of ratings on apps in Marketplace.
List¶
- GET /api/v1/apps/rating/¶
Get a list of ratings from the Marketplace
Note
Authentication is optional.
Request:
Query Parameters: - app – the ID or slug of the app whose ratings are to be returned.
- user – the ID of the user or mine whose ratings are to be returned.
The value mine can be used to filter ratings belonging to the currently logged in user.
Plus standard Listing query params.
Response:
{ "meta": { "limit": 20, "next": "/api/v1/apps/rating/?limit=20&offset=20", "offset": 0, "previous": null, "total_count": 391 }, "info": { "average": "3.4", "slug": "marble-run" }, "objects": [ { "app": "/api/v1/apps/app/18/", "body": "This app is top notch. Aces in my book!", "created": "2013-04-17T15:25:16", "is_author": true, "modified": "2013-04-17T15:34:19", "rating": 5, "resource_uri": "/api/v1/apps/rating/19/", "report_spam": "/api/v1/apps/rating/19/flag", "user": { "display_name": "chuck", "resource_uri": "/api/v1/account/settings/27/" }, "version": { "name": "1.0", "latest": true } } ] }
Parameters: - is_author (boolean) – whether the authenticated user is the author of the rating. Parameter not present in anonymous requests.
Status Codes: - 200 – success.
- 400 – submission error.
Detail¶
- GET /api/v1/apps/rating/(int: id)/¶
Get a single rating from the Marketplace using its resource_uri from the List.
Note
Authentication is optional.
Response:
{ "app": "/api/v1/apps/app/18/", "body": "This app is top notch. Aces in my book!", "created": "2013-04-17T15:25:16", "is_author": true, "modified": "2013-04-17T15:34:19", "rating": 5, "resource_uri": "/api/v1/apps/rating/19/", "user": { "display_name": "chuck", "resource_uri": "/api/v1/account/settings/27/" }, "version": { "name": "1.0", "latest": true } }
Parameters: - is_author (boolean) – whether the authenticated user is the author of the rating. Parameter not present in anonymous requests.
Status Codes: - 200 – success.
- 400 – submission error.
Create¶
- POST /api/v1/apps/rating/¶
Create a rating.
Note
Authentication required.
Request:
Parameters: - app (int) – the ID of the app being reviewed
- body (string) – text of the rating
- rating (int) – an integer between (and inclusive of) 1 and 5, indicating the numeric value of the rating
The user making the rating is inferred from the authentication details.
{ "app": 18, "body": "This app is top notch. Aces in my book!", "rating": 5 }
Response:
{ "app": 18, "body": "This app is top notch. Aces in my book!", "rating": 5 }
Status Codes: - 201 – successfully created.
- 400 – invalid submission.
- 403 – user not allowed to rate app, because the user is an author of the app or because it is a paid app that the user has not purchased.
- 409 – the user has previously rated the app, so Update should be used instead.
Update¶
- PUT /api/v1/apps/rating/(int: rating_id)/¶
Update a rating from the Marketplace using its resource_uri from the List.
Note
Authentication required.
Request:
Parameters: - body (string) – text of the rating
- rating (int) – an integer between (and inclusive of) 1 and 5, indicating the numeric value of the rating
The user making the rating is inferred from the authentication details.
{ "body": "It stopped working. All dueces, now.", "rating": 2 }
Response:
{ "app": 18, "body": "It stopped working. All dueces, now.", "rating": 2 }
Status Codes: - 202 – successfully updated.
- 400 – invalid submission.
Delete¶
- DELETE /api/v1/apps/rating/(int: rating_id)/¶
Delete a rating from the Marketplace using its resource_uri from the List.
Note
Authentication required.
Response:
Status Codes: - 204 – successfully deleted.
- 403 – the user cannot delete the rating. A user may only delete a rating if they are the original rating author, if they are an editor that is not an author of the app, or if they are in a group with Users:Edit or Addons:Edit privileges.