POST api/diet/meals/updatefood/{id}
old - update meal food unit/qty
Request Information
URI Parameters
| Name | Description | Type | Additional information |
|---|---|---|---|
| id |
authenticated user id to update food in diet plan for specific meal |
integer |
Required |
Body Parameters
update food details like unit,amount etc
UpdateFoodToMealReq| Name | Description | Type | Additional information |
|---|---|---|---|
| meal_food_id |
meal food id(Id) to update meal food |
integer |
Required |
| 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 |
| food_id |
selected food id |
integer |
Required |
| alias_id |
food alias name id |
integer |
None. |
| amount |
amount to eat |
decimal number |
Required |
| units |
selected unit of food |
integer |
None. |
| custom_unit |
custom unit for food |
string |
String length: inclusive between 0 and 150 |
| region |
food region |
string |
None. |
| comments |
any food specific comments |
string |
None. |
Request Formats
application/json, text/json
Sample:
{
"meal_food_id": 1,
"diet_id": 2,
"meal_id": 3,
"diet_template_id": 4,
"food_id": 5,
"alias_id": 1,
"amount": 6.0,
"units": 1,
"custom_unit": "sample string 7",
"region": "sample string 8",
"comments": "sample string 9"
}
application/xml, text/xml
Sample:
<update_food_to_meal_req xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/LifetronsPhoneApi.Domain.RequestAgg"> <alias_id>1</alias_id> <amount>6</amount> <comments>sample string 9</comments> <custom_unit>sample string 7</custom_unit> <diet_id>2</diet_id> <diet_template_id>4</diet_template_id> <food_id>5</food_id> <meal_food_id>1</meal_food_id> <meal_id>3</meal_id> <region>sample string 8</region> <units>1</units> </update_food_to_meal_req>
application/x-www-form-urlencoded
Sample:
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
Sample:
{
"resp_code": "sample string 1",
"resp_msg": "sample string 2"
}
application/xml, text/xml
Sample:
<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>