dambel

دمبل

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

API Docs / ratings / update



PUT /api/v1/ratings/{rating-id}

Updates a rating by its ID. Only the score can be updated.


Permissions

PermissionDescription
ratings.updateUpdate your own rating

Path Parameters

NameTypeRequiredDescriptionExample
rating-idintYesID of the rating to update123

Request Body Parameters

NameTypeRequiredDescriptionExample
scoreintYesScore between 1 and 54

Request Example

{
  "score": 4
}

Response

200 OK

Returns the updated rating resource.

Example

{
  "rating": {
    "id": 123,
    "user_id": 42,
    "ratable_type": "App\\Models\\Gym",
    "ratable_id": 10,
    "score": 4
  }
}

For a full schema, see Rating Resource.


Error Responses

StatusDescriptionReference
422Validation errorValidation error
401UnauthorizedAuthentication error
403Forbidden (no permission)Permission error
footer wave
logo

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

LinkedinInstagramXYoutube