This repository was archived by the owner on Mar 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Signed & Delegated Requests
Tom Wilson edited this page Apr 20, 2017
·
4 revisions
Signed & Delegated Requests are slightly more complex than the methods described in Basic Usage. Before making a Signed & Delegated API request; you need to obtain a ConsumerKey and SharedSecret for the user you are making requests on behalf.
This can be done using 3-Legged-Authentication which is described in detail here
Assuming you have successfully acquired a ConsumerKey and SharedSecret for the user; then you can retrieve data which is specific to that user.
For example; for our user (Steve French) we can retrieve the nutritional information of all food diary entries for a specified day.
> fatsecretR(fatsecret, "getFoodEntry", "2016-12-20", SteveFrenchToken, SteveFrenchSecret)NOTE: dates must always be in the format YYYY-MM-DD
2714897646 2714897646
food_entry_id 2714897646 2716403904
food_entry_description 1 serving Heinz Baked Beans 1 serving Tesco Quarter Pound Beef Burger
date_int 17155 17155
meal Breakfast Lunch
food_id 1480226 5540421
serving_id 1464394 5383409
number_of_units 1.000 1.000
food_entry_name Heinz Baked Beans Tesco Quarter Pound Beef Burger
calories 164 245
carbohydrate 26.70 3.50
protein 9.70 19.90
fat 0.40 16.80
saturated_fat 0 6.900
polyunsaturated_fat 0 0.700
monounsaturated_fat 0 7.800
trans_fat 0 0
cholesterol 0 0
sodium 500 1
potassium 0 0
fiber 7.7 0.6
sugar 10.30 0.30
vitamin_a 0 0
vitamin_c 0 0
calcium 0 0
iron 0 0