Get Meal Plan Settings

If you ever want to fetch and see all the crucial configuration based on which your meal plan is being generated, you must use the following endpoint as described here.

The Meal Plan API provides you two endpoints that allow you to get the meal plan settings. The only difference between the two is that one of them requires a {meal_plan_id} and the other doesn't. This arrangement has been made for a future planned feature of supporting multiple meal plans for every user.

While at the moment, since Whisk only supports a single meal plan per user, the {meal_plan_id} has been kept optional for both endpoints. You can leave it blank and it would be directly derived from the user token being used for API authentication.

get
Meal Plan Settings

https://api.whisk.com/mealplan/v2/settings
This endpoint allows you to get the meal plan settings.
Request
Response
Request
Path Parameters
meal_plan_id
optional
string
The meal-plan identifier. You can leave it blank and it would be directly derived from the user token being used for API authentication.
Response
200: OK
This how a successful get meal plan settings response looks like. To understand its data structure, see the Meal Plan Settings topic.
"settings": {
"servings": 2,
"calorie_per_day": 4000,
"included_days": [
"DAY_OF_WEEK_INVALID"
],
"included_meal_types": [
"MEAL_TYPE_INVALID"
],
"enabled_auto_generation": true,
"week_template": [
...
],
"replace_only_generated": true,
"week_start": "DAY_OF_WEEK_MONDAY",
"generation_algorithm": "GENERATION_ALGORITHM_3_MEAL",
"food_settings": {
...
},
"custom_labels": {
...
}
}
400: Bad Request
This failed response appears when specific error codes are found in the endpoint description.
{
"error_code": "REAL_CODES_ARE_IN_ENDPOINT_DESCRIPTION",
"message": "Additional details about error are not static and can be changed"
}
401: Unauthorized
This failed response appears when API authentication gets failed. The possible error codes that may appear are: auth.tokenNotFound auth.tokenExpired auth.tokenInvalid auth.tokenRequired
{
"code": "auth.tokenNotFound"
}
500: Internal Server Error
This failed response appears when something is not right at Whisk's end.
This is unexpected response, something is wrong on our side, please contact: help@whisk.com

Note: Whisk provides its APIs on the Swagger interface for you to try it out. You can call this endpoint here.

get
Meal Plan Settings

https://api.whisk.com/mealplan/v2/{meal_plan_id}/settings
This endpoint allows you to get the meal plan settings.
Request
Response
Request
Path Parameters
meal_plan_id
required
string
The meal-plan identifier.
Response
200: OK
This how a successful get meal plan settings response looks like. To understand its data structure, see the Meal Plan Settings topic.
"settings": {
"servings": 2,
"calorie_per_day": 4000,
"included_days": [
"DAY_OF_WEEK_INVALID"
],
"included_meal_types": [
"MEAL_TYPE_INVALID"
],
"enabled_auto_generation": true,
"week_template": [
...
],
"replace_only_generated": true,
"week_start": "DAY_OF_WEEK_MONDAY",
"generation_algorithm": "GENERATION_ALGORITHM_3_MEAL",
"food_settings": {
...
},
"custom_labels": {
...
}
}
400: Bad Request
This failed response appears when specific error codes are found in the endpoint description.
{
"error_code": "REAL_CODES_ARE_IN_ENDPOINT_DESCRIPTION",
"message": "Additional details about error are not static and can be changed"
}
401: Unauthorized
This failed response appears when API authentication gets failed. The possible error codes that may appear are: auth.tokenNotFound auth.tokenExpired auth.tokenInvalid auth.tokenRequired
{
"code": "auth.tokenNotFound"
}
500: Internal Server Error
This failed response appears when something is not right at Whisk's end.
This is unexpected response, something is wrong on our side, please contact: help@whisk.com

Note: Whisk provides its APIs on the Swagger interface for you to try it out. You can call this endpoint here.

Curl Call Example

curl -X GET "https://api.whisk.com/mealplan/v2/settings"
-H "accept: application/json"
-H "Authorization: Bearer <Access-Token>"