Request for data of Food


GET /openapiv2/user/user-id/food/

https://api.ihealthlabs.com:8443/openapiv2/user/a541512657584******/food.json/?access_token=XwZLq1FGG******&client_id=fb5ecd356******&client_secret=f469e9ab1******&redirect_uri=http%3a%2f%2f+yourcallback.com%2f%3fthis%3dthat&sc=58cee4ea******&sv=f62932d******&locale=en_US&page_index=1

The Request Content:
Important,
In the URL, a541512657584******means the UserID retrieved by AccessToken, which is required; otherwise, the user information cannot be accessed.
In the URL, the value of food .json is the format of the data you want to fetch, we can support two different kinds of file packages, .json and .xml.

Required Parameters:

Parameter

Description

Client_id

The ID for the client request

client_secret

The key for the request

access_token

The token for access

sc

The serial number for the user

sv

This is type of one on one value based on sv

Optional Parameters:

Parameter

Default

Description

start_time

Date time minus
3 months

The Unix time of when the food data starts, ex:1572331655(starting from 1970-01-01 0:0:0 until the present date and time, the unit is second)

page_index

First page

The page index of data, which starts from 1

locale

Default (example
in Appendix)

Set the locale location

end_time

Date time plus 1 day

The Unix time of when the food data ends, it must be later than start_time. ex: 1572418091

The Response Content

The returned values:

Parameter

Description

FoodDataList

The data detail of Food
FoodName: the name of food
MDate: measurement datetime
Lat: the latitude of the testing place
Lon: the longitude of the testing place
DataID: the unique identity
Calories: The total calories consumed
Amount: Weight of the food
TimeZone: Time zone of measurement location
FoodKind: Types of food
LastChangeTime: Time of last change (UTC)

CurrentRecordCount

The count of current page

NextPageUrl

The url of next page

PageLength

The length of one page

PageNumber

The current page

PrevPageUrl

The url of previous page

RecordCount

The total number of data records

FoodUnit

The unit of food (The explanation of value)




GET /openapiv2/application/food/

https://api.ihealthlabs.com:8443/openapiv2/application/food.json/?access_token=XwZLq1FGGQs2pI******&client_id=fb5ecd35******&client_secret=f469e9a******&redirect_uri=http%3a%2f%2f+yourcallback.com%2f%3fthis%3dthat&sc=58cee4eae6f94******&sv=f62932d1dae******&locale=en_US&page_index=1

The Request Content:
Important,
In the URL, the value of food.json is the format of the data you want to fetch, we can support two different kinds of file packages, .json and .xml.

Required Parameters:

Parameter

Description

Client_id

The ID for the client request

client_secret

The key for the request

access_token

The token for access

sc

The serial number for the user

sv

This is type of one on one value based on sv

Optional Parameters:

Parameter

Default

Description

start_time

Date time minus
3 months

The Unix time of when the food data starts, ex:1572331655(starting from 1970-01-01 0:0:0 until the present date and time, the unit is second)

page_index

First page

The page index of data, which starts from 1

locale

Default (example
in Appendix)

Set the locale / units returned

end_time

Date time plus 1 day

The Unix time of when the food data ends, it must be later than start_time. ex: 1572418091

The Response Content

The return values:

The returned values:

Parameter

Description

FoodDataList

The data detail of Food
FoodName: the name of food
MDate: measurement datetime
Lat: the latitude of the testing place
Lon: the longitude of the testing place
DataID: the unique identity
Calories: The total calories consumed
Amount: Weight of the food
TimeZone: Time zone of measurement location
FoodKind: Types of food
userid: unique identity of use
LastChangeTime: Time of last change (UTC)

CurrentRecordCount

The count of current page

NextPageUrl

The url of next page

PageLength

The length of one page

PageNumber

The current page

PrevPageUrl

The url of previous page

RecordCount

The total number of data records

FoodUnit

The unit of food (The explanation of value)