-
Notifications
You must be signed in to change notification settings - Fork 0
6. API calls
Vikram Ezhil edited this page Nov 23, 2018
·
14 revisions
The human API plugin extends humanapi wellness API calls and can easily be used in your app with a simple call.
The list of supported wellness data keys are as per below,
- activities
- activitiesSummaries
- bloodGlucose
- bloodOxygen
- bloodPressure
- bodyMassIndex
- bodyFat
- heartRate
- heartRateSummaries
- height
- weight
- locations
- meals
- sleeps
- sleepSummaries
- humanSummary
- profile
To access the wellness API data, simply 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
Cordova, Ionic 1
window.plugin.humanapi.execute("activities", "ACCESS_TOKEN", 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)
})