-
Notifications
You must be signed in to change notification settings - Fork 0
6. API calls
Vikram Ezhil edited this page Feb 2, 2019
·
14 revisions
The human API plugin extends humanapi sources API and wellness API functionalities.
The supported sources data keys are as per below,
The list of supported wellness data keys are as per below,
- activities
- activitiesSummaries
- bloodGlucoseLatest | bloodGlucose
- bloodOxygenLatest | bloodOxygen
- bloodPressureLatest | bloodPressure
- bodyMassIndexLatest | bodyMassIndex
- bodyFatLatest | bodyFat
- heartRateLatest | heartRate
- heartRateSummaries
- heightLatest | height
- weightLatest | weight
- locations
- meals
- sleeps
- sleepSummaries
- humanSummary
- profile
To access the sources/wellness API data, pass any of the above keys along with the access token to get the relevant information.
An example for getting the wellness API data for activities via normal execution & filter execution
Cordova, Ionic 1
window.plugin.humanapi.execute("activities", "ACCESS_TOKEN", function(result) {
alert("Result = " + result)
}, function(error) {
alert("Error = " + error)
})
window.plugin.humanapi.executeByFilter("activities", "ACCESS_TOKEN", "fitbit", function(result) {
alert("Result = " + result)
}, function(error) {
alert("Error = " + error)
})
Ionic 2+
var human: any = window
human.plugin.humanapi.execute("activities", "ACCESS_TOKEN", (result) => {
alert("Result = " + result)
}, (error) => {
alert("Error = " + error)
})
human.plugin.humanapi.executeByFilter("activities", "ACCESS_TOKEN", "fitbit", (result) => {
alert("Result = " + result)
}, (error) => {
alert("Error = " + error)
})