At your convenience, you can make adjustments to the meal plan settings to accordingly change or adjust your meal plan.
Note: To use the Whisk Meal Plan API, you must acquire a User Token. For more information, see User Access Tokens.
The Meal Plan API provides you two endpoints that allow you to update 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.
body
parameter as described below.{}
{"error_code": "REAL_CODES_ARE_IN_ENDPOINT_DESCRIPTION","message": "Additional details about error are not static and can be changed"}
auth.tokenNotFound
auth.tokenExpired
auth.tokenInvalid
auth.tokenRequired
{"code": "auth.tokenNotFound"}
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.
meal_plan_id
and the body
parameters as described below.{}
{"error_code": "REAL_CODES_ARE_IN_ENDPOINT_DESCRIPTION","message": "Additional details about error are not static and can be changed"}
auth.tokenNotFound
auth.tokenExpired
auth.tokenInvalid
auth.tokenRequired
{"code": "auth.tokenNotFound"}
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.
{"meal_plan_id": "string","settings": {"servings": 0,"calorie_per_day": 0,"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_INVALID","generation_algorithm": "GENERATION_ALGORITHM_INVALID","food_settings": {...},"custom_labels": {...}}}
The body object contains the following attributes and arrays that allows you to update the meal plan settings:
Attribute | Type | Description | Example Value |
| string | The meal-plan identifier. You can leave it blank when using an Access Token for API authentication. |
|
| array | This includes all the core settings that you would want to change or adjust before regenerating your meal plan. | See Meal Plan Settings. |
curl -X PUT "https://api.whisk.com/mealplan/v2/settings"-H "accept: application/json"-H "Authorization: Bearer <Access-Token>"-H "Content-Type: application/json"-d "{ \"settings\": { \"servings\": 4, \"calorie_per_day\": 8000, \"included_days\": [ \"DAY_OF_WEEK_TUESDAY\", \"DAY_OF_WEEK_SATURDAY\", \"DAY_OF_WEEK_MONDAY\", \"DAY_OF_WEEK_FRIDAY\", \"DAY_OF_WEEK_WEDNESDAY\", \"DAY_OF_WEEK_SUNDAY\", \"DAY_OF_WEEK_THURSDAY\" ], \"included_meal_types\": [ \"MEAL_TYPE_BREAKFAST\", \"MEAL_TYPE_LUNCH\", \"MEAL_TYPE_DINNER\" ], \"week_template\": [ { \"day\": \"DAY_OF_WEEK_SUNDAY\", \"meal_templates\": [ { \"meal_type\": \"MEAL_TYPE_BREAKFAST\", \"day_slot\": 3 }, { \"meal_type\": \"MEAL_TYPE_LUNCH\", \"day_slot\": 4 }, { \"meal_type\": \"MEAL_TYPE_DINNER\", \"day_slot\": 5 } ] }, { \"day\": \"DAY_OF_WEEK_MONDAY\", \"meal_templates\": [ { \"meal_type\": \"MEAL_TYPE_BREAKFAST\", \"day_slot\": 3 }, { \"meal_type\": \"MEAL_TYPE_LUNCH\", \"day_slot\": 4 }, { \"meal_type\": \"MEAL_TYPE_DINNER\", \"day_slot\": 5 } ] }, { \"day\": \"DAY_OF_WEEK_TUESDAY\", \"meal_templates\": [ { \"meal_type\": \"MEAL_TYPE_BREAKFAST\", \"day_slot\": 3 }, { \"meal_type\": \"MEAL_TYPE_LUNCH\", \"day_slot\": 4 }, { \"meal_type\": \"MEAL_TYPE_DINNER\", \"day_slot\": 5 } ] }, { \"day\": \"DAY_OF_WEEK_WEDNESDAY\", \"meal_templates\": [ { \"meal_type\": \"MEAL_TYPE_BREAKFAST\", \"day_slot\": 3 }, { \"meal_type\": \"MEAL_TYPE_LUNCH\", \"day_slot\": 4 }, { \"meal_type\": \"MEAL_TYPE_DINNER\", \"day_slot\": 5 } ] }, { \"day\": \"DAY_OF_WEEK_THURSDAY\", \"meal_templates\": [ { \"meal_type\": \"MEAL_TYPE_BREAKFAST\", \"day_slot\": 3 }, { \"meal_type\": \"MEAL_TYPE_LUNCH\", \"day_slot\": 4 }, { \"meal_type\": \"MEAL_TYPE_DINNER\", \"day_slot\": 5 } ] }, { \"day\": \"DAY_OF_WEEK_FRIDAY\", \"meal_templates\": [ { \"meal_type\": \"MEAL_TYPE_BREAKFAST\", \"day_slot\": 3 }, { \"meal_type\": \"MEAL_TYPE_LUNCH\", \"day_slot\": 4 }, { \"meal_type\": \"MEAL_TYPE_DINNER\", \"day_slot\": 5 } ] }, { \"day\": \"DAY_OF_WEEK_SATURDAY\", \"meal_templates\": [ { \"meal_type\": \"MEAL_TYPE_BREAKFAST\", \"day_slot\": 3 }, { \"meal_type\": \"MEAL_TYPE_LUNCH\", \"day_slot\": 4 }, { \"meal_type\": \"MEAL_TYPE_DINNER\", \"day_slot\": 5 } ] } ], \"week_start\": \"DAY_OF_WEEK_MONDAY\", \"generation_algorithm\": \"GENERATION_ALGORITHM_3_MEAL\",\"food_settings\": { \"labels\": [ { \"label\": { \"diet\": \"DIET_VEGETARIAN\", \"category\":\"CATEGORY_HEALTHY_RECIPES\", \"avoidance\": \"AVOIDANCE_ALCOHOL\", \"cuisine\": \"CUISINE_WORLD_CUISINE\", \"meal_type\": \"MEAL_TYPE_BRUNCH\", \"nutrition\": \"NUTRITION_HEALTHY\", \"feature\": \"video\", \"holiday\": \"HOLIDAY_INVALID\", \"seasonality\": \"SEASONALITY_INVALID\" }, \"boost\": true } ], \"include_ingredients\": { \"raw_ingredients\": [ { \"name\": \"Tomato\" } ], \"min_ingredients_should_match\": 1 }, \"health_score\": { \"from\": 4 }}}}"
​
Hint: After you update your meal plan settings, you can always crosscheck it using the Get Meal Plan Settings endpoint.
​