Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Making a simple sleep debt app - need help with oauth basics

I'm trying to make a very simple website which allows me to track sleep debt.

 

The main reason I bought a Fitbit was in order to track sleep, without the need to start/stop anything. Previously I'd been using the iOS/Android app SleepBot and I feel like Fitbit's dashboard doesn't really give me any meaningful representation of data for sleep.

 

I've created a simple page as a starting point: http://www.owengrichards.com/sleep/

 

I've got basic PHP and Javascript knowledge and I'm pretty sure that I can cope with parsing json data to get what I want. My problem is that I'm struggling with the authorization functionality and making basic requests e.g. to retrieve sleep data.

 

The docs here are useful, but I think they presume prior knowledge that I don't currently have. Is there any basic PHP/js website or pages that demonstrates really simple client <> API processes, so I can see how to get where I need to be? Or, has anyone else heard of a sleep debt app that links with Fitbit? (I know there was one called Sleep Debt, but it didn't really do what I thought it would and it seems to have disappeared).

TLDR: Making a site that calculates sleep debt. Any examples of how to use PHP to make a basic site that interacts with the API?

Best Answer
0 Votes
1 REPLY 1

@SunsetRunner has a working PHP library for making API requests when your application is authenticated. There's set up involved which may or may not be easy for developers starting out, or with limited knowledge of oauth/api's.

 

I'm working on a library but it won't be ready for some time, but it might be easy enough for those without that knowledge or experience to use.

Best Answer
0 Votes