2017 © Pedro Peláez
 

library healthgraphapi

PHP implementation of the HealthGraph API based on the StravaAPI repo from iamstuartwilson

image

inhaleexhale/healthgraphapi

PHP implementation of the HealthGraph API based on the StravaAPI repo from iamstuartwilson

  • Thursday, September 14, 2017
  • by InhaleExhale
  • Repository
  • 0 Watchers
  • 1 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 27 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

StravaApi

Simple PHP class to interact with Runkeeper's HealthGraph API. Forked from Iamstuartwilson/strava., (*1)

Build Status Minimum PHP Version, (*2)

Overview

The class simply houses methods to help send data to and recieve data from the API., (*3)

Please read the API documentation to see what endpoints are available., (*4)

There is currently no file upload support at this time, (*5)

Installation

With Composer

$ composer require iamstuartwilson/strava

Or, (*6)

Add InhaleExhale/runkeeper-php to your composer.json:, (*7)

``` json { "require" : { "iamstuartwilson/strava" : "~1.3" } }, (*8)


### Manually Copy `HealthGraphApi.php` to your project and *require* it in your application as described in the next section. Getting Started ------------ Include the class and instantiate with your **client_id** and **client_secret** from your [registered app](http://www.strava.com/developers): ``` php require_once 'HealthGraphApi.php'; $api = new InhaleExhale\HealthGraphApi( $clientId, $clientSecret );

You will then need to authenticate your strava account by requesting an access code [1]. You can generate a URL for authentication using the following method:, (*9)

``` php $api->authenticationUrl($redirect, $approvalPrompt = 'auto', $scope = null, $state = null);, (*10)


When a code is returned you must then exchange it for an [access token](http://strava.github.io/api/v3/oauth/#post-token) for the authenticated user: ``` php $api->tokenExchange($code);

Before making any requests you must set the access token as returned from your token exchange or via your own private token from Strava:, (*11)

``` php $api->setAccessToken($accessToken);, (*12)


Example Requests ------------ Get the most recent 100 KOMs from any athlete ``` php $api->get('athletes/:id/koms', ['per_page' => 100]);

Post a new activity [2], (*13)

``` php $api->post('activities', [ 'name' => 'API Test', 'type' => 'Ride', 'start_date_local' => date( 'Y-m-d\TH:i:s\Z'), 'elapsed_time' => 3600 ]);, (*14)


Update a athlete's weight *[2]* ``` php $api->put('athlete', ['weight' => 70]);

Delete an activity [2], (*15)

php $api->delete('activities/:id');, (*16)

Notes

1. The account you register your app will give you an access token, so you can skip this step if you're just testing endpoints/methods., (*17)

2. These actions will need the scope set to write when authenticating a user, (*18)


Historic Releases

Previous version 1.2.2, (*19)

Updates include:, (*20)

  • Possibility to access the HTTP response headers
  • PHP 7 compatibility
  • Basic PHPUnit test cases for Auth URL generation

The Versions

14/09 2017

dev-master

9999999-dev

PHP implementation of the HealthGraph API based on the StravaAPI repo from iamstuartwilson

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

by Ian Hales

14/09 2017

0.0.3

0.0.3.0

PHP implementation of the HealthGraph API based on the StravaAPI repo from iamstuartwilson

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

by Ian Hales

14/09 2017

0.0.2

0.0.2.0

PHP implementation of the HealthGraph API based on the StravaAPI repo from iamstuartwilson

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

by Ian Hales

14/09 2017

0.0.1

0.0.1.0

PHP implementation of the HealthGraph API

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

by Ian Hales