MShealth
Ruby API wrapper for the Microsoft Health Cloud.
Installation
Add this line to your application's Gemfile:
gem 'MShealth'
And then execute:
$ bundle
Or install it yourself as:
$ gem install MShealth
Usage
Check get started on how to register application and the application authentication scheme.
Set the token:
MShealth.configure do |c|
c.token = "your token"
end
Then get client:
client = MShealth.client
Profile
client.profile
Devices
client.device(id:'FFFF1700-FFFF-FFFF-8529-454E11000210')
client.devices
Activities
activity = client.activity(id:"2519647921241112976",details:1,minute_summaries:1,map_points:1)
activities = client.activities(start_time:Time.new(2015,5,27),
end_time:Time.new(2015,7,29),
activity_types:"Run,Sleep",
details:1,
minute_summaries:1,
map_points:1)
Summary
summary = client.summary(period:'hourly',
start_time:Time.new(2015,6,27),
end_time:Time.new(2015,7,20),
device_id:"FFFF1700-FFFF-FFFF-8529-454E11000210")
Return object
All returns are stored in a hash-like Mash object. All naming of parameters are ruby-ish.(eg:firstName -> first_name)
profile = client.profile
profile.first_name
puts profile.to_yaml
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/yielder/MShealth.
Todo
- Add documentation
- Add oauth2 support
License
The gem is available as open source under the terms of the MIT License.