POST api/diet/meals/mealtype/{id}?dpId={dpId}&mealtime={mealtime}&mealTimeMin={mealTimeMin}&mId={mId}
old - add or edit meal type for diet 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 |
| dpId |
diet plan id |
integer |
Required |
| mealtime |
meal time in utc epoch |
decimal number |
Required |
| mealTimeMin |
string meal time in 24 hrs hrs:min:sec format |
string |
Required |
| mId |
meal id incase of edit |
integer |
None. |
Body Parameters
add food details like unit,amount etc
AddMealTypeReq| Name | Description | Type | Additional information |
|---|---|---|---|
| diet_template_id |
diet template id |
integer |
Required |
| title |
custom meal type name |
string |
Required |
| meal_number |
old meal sequance number from diet plan |
integer |
None. |
| add_to_entire_plan |
add food to all days in template |
boolean |
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
Sample:
{
"diet_template_id": 1,
"title": "sample string 2",
"meal_number": 3,
"add_to_entire_plan": true,
"diet_plan_ids": [
1,
2
]
}
application/xml, text/xml
Sample:
<add_meal_type_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>
<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>1</diet_template_id>
<meal_number>3</meal_number>
<title>sample string 2</title>
</add_meal_type_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>