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(id)
Export Route GPX
Returns a GPX file of the route. Requires read_all scope for private routes.
// 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();
}
Name | Type | Description | Notes |
---|---|---|---|
id | Long | The identifier of the route. |
null (empty response body)
- Content-Type: Not defined
- Accept: application/json
getRouteAsTCX(id)
Export Route TCX
Returns a TCX file of the route. Requires read_all scope for private routes.
// 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();
}
Name | Type | Description | Notes |
---|---|---|---|
id | Long | The identifier of the route. |
null (empty response body)
- Content-Type: Not defined
- Accept: application/json
Route getRouteById(id)
Get Route
Returns a route using its identifier. Requires read_all scope for private routes.
// 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();
}
Name | Type | Description | Notes |
---|---|---|---|
id | Long | The identifier of the route. |
- Content-Type: Not defined
- Accept: application/json
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.
// 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();
}
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] |
- Content-Type: Not defined
- Accept: application/json