fabulator/fitbit-api-base

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (v1.0.1) of this package.

Very basic Fitbit API.

v1.0.1 2017-04-02 12:50 UTC

This package is auto-updated.

Last update: 2020-09-11 19:33:10 UTC


README

Very basic Fitbit API. You can work with Oauth tokens and request API endpoints.

First get login url:

$fitbit = new Fabulator\FitbitAPI('YOUR_CLIENT_ID', 'YOUR_SECRET_ID');
$fitbit->getLoginUrl('YOUR_RETURN_URL', ['profile']);

You will retrive code after login. Use it to request access token:

echo json_decode((string) $fitbit->requestAccessToken('YOUR_CODE', 'YOUR_RETURN_URL')->getBody())->access_token;

You can use Access token to request Fitbit API endpoints:

print_r(json_decode((string) $fitbit->get('profile')->getBody()))