Skip to content

Latest commit

 

History

History
223 lines (160 loc) · 6.3 KB

RoutesApi.md

File metadata and controls

223 lines (160 loc) · 6.3 KB

RoutesApi

All URIs are relative to https://www.strava.com/api/v3

Method HTTP request Description
getRouteAsGPX GET /routes/{id}/export_gpx Export Route GPX
getRouteAsTCX GET /routes/{id}/export_tcx Export Route TCX
getRouteById GET /routes/{id} Get Route
getRoutesByAthleteId GET /athletes/{id}/routes List Athlete Routes

getRouteAsGPX

getRouteAsGPX(id)

Export Route GPX

Returns a GPX file of the route. Requires read_all scope for private routes.

Example

// Import classes:
//import io.github.jfermat.strava.invoker.ApiClient;
//import io.github.jfermat.strava.invoker.ApiException;
//import io.github.jfermat.strava.invoker.Configuration;
//import io.github.jfermat.strava.invoker.auth.*;
//import io.github.jfermat.strava.api.RoutesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: strava_oauth
OAuth strava_oauth = (OAuth) defaultClient.getAuthentication("strava_oauth");
strava_oauth.setAccessToken("YOUR ACCESS TOKEN");

RoutesApi apiInstance = new RoutesApi();
Long id = 789L; // Long | The identifier of the route.
try {
    apiInstance.getRouteAsGPX(id);
} catch (ApiException e) {
    System.err.println("Exception when calling RoutesApi#getRouteAsGPX");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id Long The identifier of the route.

Return type

null (empty response body)

Authorization

strava_oauth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getRouteAsTCX

getRouteAsTCX(id)

Export Route TCX

Returns a TCX file of the route. Requires read_all scope for private routes.

Example

// Import classes:
//import io.github.jfermat.strava.invoker.ApiClient;
//import io.github.jfermat.strava.invoker.ApiException;
//import io.github.jfermat.strava.invoker.Configuration;
//import io.github.jfermat.strava.invoker.auth.*;
//import io.github.jfermat.strava.api.RoutesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: strava_oauth
OAuth strava_oauth = (OAuth) defaultClient.getAuthentication("strava_oauth");
strava_oauth.setAccessToken("YOUR ACCESS TOKEN");

RoutesApi apiInstance = new RoutesApi();
Long id = 789L; // Long | The identifier of the route.
try {
    apiInstance.getRouteAsTCX(id);
} catch (ApiException e) {
    System.err.println("Exception when calling RoutesApi#getRouteAsTCX");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id Long The identifier of the route.

Return type

null (empty response body)

Authorization

strava_oauth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getRouteById

Route getRouteById(id)

Get Route

Returns a route using its identifier. Requires read_all scope for private routes.

Example

// Import classes:
//import io.github.jfermat.strava.invoker.ApiClient;
//import io.github.jfermat.strava.invoker.ApiException;
//import io.github.jfermat.strava.invoker.Configuration;
//import io.github.jfermat.strava.invoker.auth.*;
//import io.github.jfermat.strava.api.RoutesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: strava_oauth
OAuth strava_oauth = (OAuth) defaultClient.getAuthentication("strava_oauth");
strava_oauth.setAccessToken("YOUR ACCESS TOKEN");

RoutesApi apiInstance = new RoutesApi();
Long id = 789L; // Long | The identifier of the route.
try {
    Route result = apiInstance.getRouteById(id);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RoutesApi#getRouteById");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id Long The identifier of the route.

Return type

Route

Authorization

strava_oauth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getRoutesByAthleteId

List<Route> getRoutesByAthleteId(page, perPage)

List Athlete Routes

Returns a list of the routes created by the authenticated athlete. Private routes are filtered out unless requested by a token with read_all scope.

Example

// Import classes:
//import io.github.jfermat.strava.invoker.ApiClient;
//import io.github.jfermat.strava.invoker.ApiException;
//import io.github.jfermat.strava.invoker.Configuration;
//import io.github.jfermat.strava.invoker.auth.*;
//import io.github.jfermat.strava.api.RoutesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: strava_oauth
OAuth strava_oauth = (OAuth) defaultClient.getAuthentication("strava_oauth");
strava_oauth.setAccessToken("YOUR ACCESS TOKEN");

RoutesApi apiInstance = new RoutesApi();
Integer page = 56; // Integer | Page number. Defaults to 1.
Integer perPage = 30; // Integer | Number of items per page. Defaults to 30.
try {
    List<Route> result = apiInstance.getRoutesByAthleteId(page, perPage);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling RoutesApi#getRoutesByAthleteId");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
page Integer Page number. Defaults to 1. [optional]
perPage Integer Number of items per page. Defaults to 30. [optional] [default to 30]

Return type

List<Route>

Authorization

strava_oauth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json