Skip to content

Latest commit

 

History

History
118 lines (80 loc) · 3.19 KB

SegmentEffortsApi.md

File metadata and controls

118 lines (80 loc) · 3.19 KB

StravaApiV3.SegmentEffortsApi

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

Method HTTP request Description
getEffortsBySegmentId GET /segments/{id}/all_efforts List Segment Efforts
getSegmentEffortById GET /segment_efforts/{id} Get Segment Effort

getEffortsBySegmentId

[DetailedSegmentEffort] getEffortsBySegmentId(id, opts)

List Segment Efforts

Returns a set of the authenticated athlete's segment efforts for a given segment.

Example

var StravaApiV3 = require('strava_api_v3');
var defaultClient = StravaApiV3.ApiClient.instance;

// Configure OAuth2 access token for authorization: strava_oauth
var strava_oauth = defaultClient.authentications['strava_oauth'];
strava_oauth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new StravaApiV3.SegmentEffortsApi();

var id = 56; // Number | The identifier of the segment.

var opts = { 
  'page': 56, // Number | Page number.
  'perPage': 30 // Number | Number of items per page. Defaults to 30.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getEffortsBySegmentId(id, opts, callback);

Parameters

Name Type Description Notes
id Number The identifier of the segment.
page Number Page number. [optional]
perPage Number Number of items per page. Defaults to 30. [optional] [default to 30]

Return type

[DetailedSegmentEffort]

Authorization

strava_oauth

HTTP request headers

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

getSegmentEffortById

DetailedSegmentEffort getSegmentEffortById(id)

Get Segment Effort

Returns a segment effort from an activity that is owned by the authenticated athlete.

Example

var StravaApiV3 = require('strava_api_v3');
var defaultClient = StravaApiV3.ApiClient.instance;

// Configure OAuth2 access token for authorization: strava_oauth
var strava_oauth = defaultClient.authentications['strava_oauth'];
strava_oauth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new StravaApiV3.SegmentEffortsApi();

var id = 789; // Number | The identifier of the segment effort.


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getSegmentEffortById(id, callback);

Parameters

Name Type Description Notes
id Number The identifier of the segment effort.

Return type

DetailedSegmentEffort

Authorization

strava_oauth

HTTP request headers

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