dev-master
9999999-dev https://github.com/zabouth/PHPMovesMoves App API
GPL-3.0+
The Requires
- php >=5.3.3
by Graeme Dyas
php moves zabouth
Wallogit.com
2017 © Pedro Peláez
Moves App API
Create a new instance of the PHPMoves class using the client_id and client_secret provided by moves, (*1)
$m = new PHPMoves\Moves('client_id','client_secret','redirect_url');
Generate a request URL and present it to the user., (*2)
$request_url = $m->requestURL(); <a href="<?php echo $request_url; ?>">Click Here</a>
Once the user has authenticated successfully they will be redirected back to the redirect_url with an authorization code included in the request. This code is passed to the auth method to obtain an access_token and refresh_token. The access token will be used for all future API calles. The refresh_token is used to request a new access_token if the current token becomes invalid or expires., (*3)
$request_token = $_GET['code']; $tokens = $m->auth($request_token); $access_token = $tokens['access_token']; $refresh_token = $tokens['refresh_token'];
The access_token can now be used to make API., (*4)
echo json_encode($m->get_profile($access_token));
Generates a URL for the move API authentication page., (*5)
Checks if an access_token is valid returns false if the token has been expired or revoked., (*6)
Exchanges an authorization code for an access token and refresh token. Returns an associative array containing both., (*7)
Refreshes the access token and refresh token also expires both old tokens. Returns an associative array containing the updated tokens., (*8)
Returns the users moves profile as an array., (*9)
Used to fetch API data between two date ranges $start and $end need to be a date in the format yyyyMMdd or yyyy-MM-dd the maximum request size is 7 days. Returns an array, see examples for usage., (*10)
$summary = $m->get_range($access_token,'/user/summary/daily', $start, $end) $activities = $m->get_range($access_token,'/user/activities/daily', $start, $end) $places = $m->get_range($access_token,'/user/places/daily', $start, $end) $storyline = $m->get_range($access_token,'/user/storyline/daily', $start, $end)
Moves App API
GPL-3.0+
php moves zabouth