Rate a meal or delete a meal rating.
https://www.mensa-kl.de/api/v1/rate-mealPOST with JSON bodyint meal_id:
The meal ID to rate.
Heads up: Not all meals can be rated. Additionally, meals older than one week and meals that were not yet served cannot be rated.
int|null rating:
The new meal rating.
Valid values: 1 (worst rating), 2, 3, 4, and 5 (best rating).
null deletes the rating.
curl -X POST "https://www.mensa-kl.de/api/v1/rate-meal" \
-H "Authorization: Bearer $AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"meal_id": 123,
"rating": 5
}'
The data envelope contains the following rating details:
int rating_count:
The amount of ratings for the given meal.
float|null rating_average:
The average rating for the given meal.
null if not yet rated.
float|null rating_median:
The median rating for the given meal.
null if not yet rated.
int|null rating_personal:
The personal rating for the given meal.
null if not yet rated or if the rating was deleted.
{
"status": "success",
"data": {
"rating_count": 42,
"rating_average": 4.2,
"rating_median": 4.0,
"rating_personal": 5
}
}
{
"status": "success",
"data": {
"rating_count": 41,
"rating_average": 4.19,
"rating_median": 4.0,
"rating_personal": null
}
}
Meal rating can fail for many reasons. Examples:
meal_id) does not exist