1. Go to this page and download the library: Download jyokum/healthgraph library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$hgc = HealthGraphClient::factory();
$hgc->getUser(array(
'access_token' => $token['access_token'],
'token_type' => $token['token_type'],
));
// Get the entire feed, this could return a lot of data.
$command = $hgc->getIterator('GetFitnessActivityFeed');
$result = $command->toArray();
// Get the 5 most recent activities.
$command = $hgc->getIterator('GetFitnessActivityFeed')->setLimit(5);
$result = $command->toArray();