-1

I'm trying to log Meal Entry using Jawbone API. In API documentation described sub_type parameter which is responsible for Meal Type (breakfast/lunch/dinner). However it looks like this parameter doesn't control anything and everything is controlled by time_created/tz parameters. Could anyone help me to understand exact logic responsible for where Logged Meal goes - Breakfast/Lunch/Dinner/Snack.


update 20/09/2016

I'd like to be able to log Meal(as Breakfast/Dinner/Lunch or Snack) and see result in user feed as Breakfast/Dinner/Lunch or Snack (https://jawbone.com/up/food/meals). For now I'm interested only in these 4 Meal Types because of compatibility with our app.

I've found that it can be achieved by specifying time_created = (${begin_of_the_day} + mealTypeAdjustment), where mealTypeAdjustment=

-7h for Breakfast

-13h for Lunch

-19h for Dinner

these numbers are just my assumption which work so far. But there is no Jawbone documentation about this logic so my questions:

1) how can I controll using time_created, where logged Meal appears in user feed(Breakfast/Dinner/Lunch or Snack)?

2) I still didn't get how to log Snack. Few times I was able to do it by randomizing input parameters but unfortunately I can't reproduce it now.

1 Answers1

0

The sub_type is just a piece of metadata about the meal in case you would like to classify a meal as breakfast/lunch/dinner.

Where a meal entry appears in a user's feed is dictated by time_created. In fact, there is no direct connection between time_created and sub_type.

Here are all the meal sub_type values:

sub_type     | value
-------------|-------
Breakfast    | 1
Lunch        | 2
Dinner       | 3
Pre-Workout  | 4
Post-Workout | 5
Snack        | 6 
RAY
  • 474
  • 4
  • 21
  • Thank you for the answer, RAY. But what is the time ranges for time_created to be Breakfast/Lunch/Dinner? I cant find it in documentation. Also I’m wondering how can I create snack meal. – Yauhen Hankovich Sep 20 '16 at 10:22
  • There is no direct connection between time_created and a designation as Breakfast/Lunch/Dinner. I have updated my answer and the meals endpoint documentation with the other meal types. – RAY Sep 20 '16 at 15:34
  • Thank you for the answer, I've got that there is no connection between time_created and sub_type, but think I was not clear enough asking this question, I've updated initial post with more details. – Yauhen Hankovich Sep 20 '16 at 16:28