Download the PHP package iamstuartwilson/strava without Composer

On this page you can find all versions of the php package iamstuartwilson/strava. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package strava

Build Status Minimum PHP Version Packagist Packagist Downloads

StravaApi

The class simply houses methods to help send data to and receive data from the API. Please read the API documentation to see what endpoints are available.

There is no file upload support at this time.

Installation

With Composer

Or add it manually to your composer.json:

Manually

Copy StravaApi.php to your project and require it in your application as described in the next section.

Getting Started

Instantiate the class with your client_id and client_secret from your registered app:

If you're just testing endpoints/methods you can skip the authentication flow and just use the access token from your settings page.

You will then need to authenticate your strava account by requesting an access code. You can generate a URL for authentication using the following method:

When a code is returned you must then exchange it for an access token and a refresh token for the authenticated user:

The token exchange result contains among other data the tokens. You can access them as attributes of the result object:

Before making any requests you must set the access and refresh tokens as returned from your token exchange result or via your own private token from Strava:

Example oAuth2 Authentication Flow

examples/oauth-flow.php demonstrates how the oAuth2 authentication flow works.

  1. Choose how to load the StravaApi.php – either via Composer autoloader or by manually requiring it.
  2. Replace the three config values CALLBACK_URL, STRAVA_API_ID, and STRAVA_API_SECRET at the top of the file
  3. Place the file on your server so that it's accessible at CALLBACK_URL
  4. Point your browser to CALLBACK_URL and start the authentication flow.

The scripts prints a lot of verbose information so you get an idea on how the Strava oAuth flow works.

Example Requests

Once successfully authenticated you're able to communicate with Strava's API.

All actions that change Strava contents (post, put, delete) will need the scope set to write in the authentication flow.

Get Athlete Stats

List Athlete Activities

Some API endpoints support GET parameters:

Post a new activity

Update a athlete's weight

Releases

See CHANGELOG.md.


All versions of strava with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package iamstuartwilson/strava contains the following files

Loading the files please wait ....