dambel

دمبل

shevron
ورود | ثبت نام

API Docs / ratings / all



GET /api/v1/ratings/all

Retrieves all ratings in the system (admin only), with support for filtering and pagination.


Permissions

PermissionDescription
ratings.view_allView all ratings in the system (admin only)

Query Parameters

NameTypeRequiredDescriptionExample
typestringNoRatable type (App\Models\Gym, App\Models\TrainingService). Comma-separated for multiple types"App\Models\Gym,App\Models\TrainingService"
item_idintNoRatable ID(s) to filter by (comma-separated for multiple)"1,2,3"
user_idintNoUser ID(s) who rated (comma-separated for multiple)"5,6"
from_datestringNoStart of date range (YYYY-MM-DD)"2024-01-01"
to_datestringNoEnd of date range (YYYY-MM-DD)"2024-01-31"
from_scoreintNoMinimum score3
to_scoreintNoMaximum score5
orderstringNoOrder of results: ASC or DESC (default: DESC)"DESC"

Response

200 OK

Returns a paginated list of rating resources.

Schema

{
  "data": [
    { /* Rating Resource */ }
  ],
  "links": { /* Pagination Data */ },
  "meta": { /* Pagination Data */ }
}

Example

{
  "data": [
    {
      "id": 123,
      "user_id": 42,
      "ratable_type": "App\\Models\\Gym",
      "ratable_id": 10,
      "score": 5
    }
  ],
  "links": {
    "first": "https://api.example.com/api/v1/ratings/all?page=1",
    "last": "https://api.example.com/api/v1/ratings/all?page=10",
    "prev": null,
    "next": "https://api.example.com/api/v1/ratings/all?page=2"
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 10,
    "path": "https://api.example.com/api/v1/ratings/all",
    "per_page": 50,
    "to": 50,
    "total": 500
  }
}

For a full schema, see Rating Resource and Pagination Data.


Error Responses

StatusDescriptionReference
401UnauthorizedAuthentication error
403Forbidden (no permission)Permission error
404Not foundNot-found error
footer wave
logo

دمبل، دنیای هوشمند ورزش و تغذیه

LinkedinInstagramXYoutube