POST api/diet/meals/addcustomfood/{id}
old - add custom food to meals for single day or for entire plan
Request Information
URI Parameters
| Name | Description | Type | Additional information |
|---|---|---|---|
| id |
authenticated user id to add food in diet plan for specific meal |
integer |
Required |
Body Parameters
add food details like unit,amount etc
AddCustomFoodToMealReq| Name | Description | Type | Additional information |
|---|---|---|---|
| diet_id |
diet plan id from diet template |
integer |
Required |
| meal_id |
meal id from diet plan |
integer |
Required |
| diet_template_id |
diet template id |
integer |
Required |
| meal_type_id |
selected meal type |
integer |
Required |
| add_to_entire_plan |
add food to all days in template |
boolean |
None. |
| food_name |
custom food name |
string |
Required |
| amount |
amount to eat |
decimal number |
Required |
| units |
selected unit of food |
string |
Required |
| grams |
food total grams for given quantity and unit |
decimal number |
None. |
| food_time |
food time to eat |
decimal number |
Required |
| food_time_min |
food time in string |
string |
None. |
| region |
food region |
string |
Required |
| opt_meal_food_id |
optional meal foodid |
integer |
None. |
| is_locked |
meals food update in diet plan. user will only see when is it not locked |
boolean |
None. |
| comments |
any food specific comment |
string |
None. |
| meal_type_name |
name of meal incase add to entire plan is true. |
string |
None. |
| diet_plan_ids |
list of diet plan ids to add food in multiple days |
Collection of integer |
None. |
Request Formats
application/json, text/json
{
"diet_id": 1,
"meal_id": 2,
"diet_template_id": 3,
"meal_type_id": 4,
"add_to_entire_plan": true,
"food_name": "sample string 6",
"amount": 7.0,
"units": "sample string 8",
"grams": 1.0,
"food_time": 9.1,
"food_time_min": "sample string 10",
"region": "sample string 11",
"opt_meal_food_id": 1,
"is_locked": true,
"comments": "sample string 13",
"meal_type_name": "sample string 14",
"diet_plan_ids": [
1,
2
]
}
application/xml, text/xml
<add_custom_food_to_meal_req xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/LifetronsPhoneApi.Domain.RequestAgg.v5.diet">
<add_to_entire_plan>true</add_to_entire_plan>
<amount>7</amount>
<comments>sample string 13</comments>
<diet_id>1</diet_id>
<diet_plan_ids xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:int>1</d2p1:int>
<d2p1:int>2</d2p1:int>
</diet_plan_ids>
<diet_template_id>3</diet_template_id>
<food_name>sample string 6</food_name>
<food_time>9.1</food_time>
<food_time_min>sample string 10</food_time_min>
<grams>1</grams>
<is_locked>true</is_locked>
<meal_id>2</meal_id>
<meal_type_id>4</meal_type_id>
<meal_type_name>sample string 14</meal_type_name>
<opt_meal_food_id>1</opt_meal_food_id>
<region>sample string 11</region>
<units>sample string 8</units>
</add_custom_food_to_meal_req>
application/x-www-form-urlencoded
Sample not available.
Response Information
Resource Description
On success, returns diet plans. On failure, return empty list failure reason.
Response| Name | Description | Type | Additional information |
|---|---|---|---|
| resp_code |
Lifetrons response code |
string |
None. |
| resp_msg |
Lifetrons response message |
string |
None. |
Response Formats
application/json, text/json
{
"resp_code": "sample string 1",
"resp_msg": "sample string 2"
}
application/xml, text/xml
<Response xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/LifetronsPhoneApi.Models"> <resp_code>sample string 1</resp_code> <resp_msg>sample string 2</resp_msg> </Response>