Ratings¶
These endpoints allow the retrieval, creation, and modification of ratings on apps in Marketplace.
List¶
-
GET
/api/v2/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.
- lang – a language to filter ratings by if match_lang is set.
- match_lang – a boolean to specify to match language or not. If 1, only results matching lang are returned. Otherwise all results are 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": 25, "next": "/api/v2/apps/rating/?limit=25&offset=25", "offset": 0, "previous": null, "total_count": 391 }, "info": { "average": "3.4", "slug": "marble-run", "total_reviews": 391 }, "objects": [ { "app": "/api/v2/apps/app/18/", "body": "This app is top notch. Aces in my book!", "created": "2013-04-17T15:25:16", "is_author": true, "lang": "en", "modified": "2013-04-17T15:34:19", "rating": 5, "resource_uri": "/api/v2/apps/rating/19/", "report_spam": "/api/v2/apps/rating/19/flag", "user": { "display_name": "chuck", "resource_uri": "/api/v2/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 OK – success.
- 400 Bad Request – submission error.
Detail¶
-
GET
/api/v2/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/v2/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/v2/apps/rating/19/", "user": { "display_name": "chuck", "resource_uri": "/api/v2/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 OK – success.
- 400 Bad Request – submission error.
Create¶
-
POST
/api/v2/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 Created – successfully created.
- 400 Bad Request – invalid submission.
- 403 Forbidden – 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 Conflict – the user has previously rated the app, so Update should be used instead.
Update¶
-
PUT
/api/v2/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 Accepted – successfully updated.
- 400 Bad Request – invalid submission.
Delete¶
-
DELETE
/api/v2/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 No Content – successfully deleted.
- 403 Forbidden – 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.