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.

Maintainers

Package info

github.com/fabulator/fitbit-api-base

pkg:composer/fabulator/fitbit-api-base

Statistics

Installs: 795

Dependents: 1

Suggesters: 0

Stars: 1

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()))