POST api/diet/meals/addfood/{id}

user diet plan with it's meals details

Request Information

URI Parameters

NameDescriptionTypeAdditional 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

AddFoodToMealReq
NameDescriptionTypeAdditional 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

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

Required

add_to_entire_plan

add food to all days in template

boolean

None.

food_time

food time to eat

decimal number

Required

food_time_min

food time in string

string

None.

food_filter

food filter or category recipe, basic_food etc

string

None.

comments

any food specific comments

string

None.

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.

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

Sample:
{
  "diet_id": 1,
  "meal_id": 2,
  "diet_template_id": 3,
  "meal_type_id": 4,
  "food_id": 5,
  "alias_id": 1,
  "amount": 6.0,
  "units": 7,
  "add_to_entire_plan": true,
  "food_time": 9.1,
  "food_time_min": "sample string 10",
  "food_filter": "sample string 11",
  "comments": "sample string 12",
  "opt_meal_food_id": 1,
  "is_locked": true,
  "meal_type_name": "sample string 14",
  "diet_plan_ids": [
    1,
    2
  ]
}

application/xml, text/xml

Sample:
<add_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>
  <alias_id>1</alias_id>
  <amount>6</amount>
  <comments>sample string 12</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_filter>sample string 11</food_filter>
  <food_id>5</food_id>
  <food_time>9.1</food_time>
  <food_time_min>sample string 10</food_time_min>
  <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>
  <units>7</units>
</add_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
NameDescriptionTypeAdditional 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>