2017 © Pedro Peláez
 

library fitbit

Fitbit REST API library

image

demo-git/fitbit

Fitbit REST API library

  • Thursday, December 1, 2016
  • by demo-git
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

Fitbit API

Very basic Fitbit API. There are working Oauth 2 and few Fitbit endpoints., (*1)

Examples

First you have to generate login url., (*2)

$fitbit = new Fitbit('Client ID', 'Client (Consumer) Secret');
echo $fitbit->getLoginUrl('http://yourcallbackurl.cz', ['profile']);

User is redirected to your callback url with code in paramters. Get this code and request token from fitbit., (*3)

$token = $fitbit->getToken('CODE', 'http://yourcallbackurl.cz');
$fitbit->setToken($token);

Token have only 1 hour duration and you have to use refresh token endpoint, (*4)

if ($_SESSION['fitbit']->dateExpire <= time()) {
    $_SESSION['fitbit'] = $fitbit->refreshToken($_SESSION['fitbit']);
    $_SESSION['fitbit']->dateExpire = (time() - 60) + $_SESSION['fitbit']->expires_in;
}

After you have token, you can use Fitbit endpoints., (*5)

print_r($fitbit->profile->get());

$fitbit->sleep->log(new \DateTime("2016-03-10 10:24"), 8 *60 * 60 * 1000);

print_r($fitbit->water->get(new \DateTime("2016-03-10")));

The Versions

01/12 2016

dev-master

9999999-dev https://github.com/demo-git/Fitbit

Fitbit REST API library

  Sources   Download

The Requires

 

fitbit

01/12 2016

1.1

1.1.0.0 https://github.com/demo-git/Fitbit

Fitbit REST API library

  Sources   Download

The Requires

 

fitbit

01/12 2016

dev-develop

dev-develop https://github.com/demo-git/Fitbit

Fitbit REST API library

  Sources   Download

The Requires

 

fitbit

17/11 2016

1.0.2

1.0.2.0 https://github.com/demo-git/Fitbit

Fitbit REST API library

  Sources   Download

The Requires

 

17/11 2016

1.0.1

1.0.1.0 https://github.com/demo-git/Fitbit

Fitbit REST API library

  Sources   Download

The Requires

 

17/11 2016

1.0

1.0.0.0 https://github.com/demoFitbit/Fitbit

Fitbit REST API library

  Sources   Download

The Requires

 

14/03 2016

v0.2.0

0.2.0.0 https://github.com/fabulator/Fitbit

Fitbit REST API library

  Sources   Download

The Requires

 

10/03 2016

v0.1.0

0.1.0.0 https://github.com/fabulator/Fitbit

Fitbit REST API library

  Sources   Download

The Requires