Table of Contents

Interface ISegmentEffortsApi

Namespace
Tudormobile.Strava.Api
Assembly
Tudormobile.Strava.dll

Strava V3 Segment Efforts API Interface.

public interface ISegmentEffortsApi

Methods

GetSegmentEffortAsync(long, CancellationToken)

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

Task<ApiResult<SegmentEffort>> GetSegmentEffortAsync(long id, CancellationToken cancellationToken = default)

Parameters

id long

The unique identifier of the segment effort.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<ApiResult<SegmentEffort>>

An ApiResult<T> containing the SegmentEffort if successful; otherwise, an error.

ListSegmentEffortsAsync(long, DateTime?, DateTime?, int?, CancellationToken)

Asynchronously retrieves a list of efforts for a specified segment, optionally filtered by local start and end dates.

Task<ApiResult<List<SegmentEffort>>> ListSegmentEffortsAsync(long segmentId, DateTime? startDateLocal = null, DateTime? endDateLocal = null, int? perPage = null, CancellationToken cancellationToken = default)

Parameters

segmentId long

The unique identifier of the segment for which to retrieve efforts.

startDateLocal DateTime?

The earliest local start date and time for efforts to include in the results. Only efforts starting on or after this date are returned. If null, no lower date filter is applied.

endDateLocal DateTime?

The latest local start date and time for efforts to include in the results. Only efforts starting on or before this date are returned. If null, no upper date filter is applied.

perPage int?

The maximum number of efforts to return per page. If null, the default page size is used. Must be positive if specified.

cancellationToken CancellationToken

A cancellation token that can be used to cancel the asynchronous operation.

Returns

Task<ApiResult<List<SegmentEffort>>>

A task that represents the asynchronous operation. The task result contains an ApiResult<T> with a list of SegmentEffort objects matching the specified criteria. The list may be empty if no efforts are found.