List segments
GET
/api/v1/activities/{activityId}/segments
const url = 'http://localhost:8080/api/v1/activities/activity-9756441741/segments';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://localhost:8080/api/v1/activities/activity-9756441741/segments \ --header 'Authorization: Bearer <token>'Lists the segment one activity in the order they were ridden
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”activityId
required
string
The prefixed activity identifier, activity- included.
Responses
Section titled “Responses”All segment efforts of the activity.
Media typeapplication/json
object
segmentEfforts
required
Array<object>
object
id
required
string
segmentId
required
string
name
required
The name of the segment.
string
startDateLocal
required
string
elapsedTimeInSeconds
required
integer
distanceInMeter
required
integer
averagePower
required
number | null
averageHeartRate
required
integer | null
maxHeartRate
required
integer | null
rank
required
The position of this effort among all efforts on the segment, fastest first.
integer | null
pagination
required
object
page
required
integer
size
required
integer
total
required
integer
totalPages
required
integer
Example
{ "segmentEfforts": [ { "id": "segmentEffort-3159640357452378822", "segmentId": "segment-17267489", "name": "Alpe du Zwift", "startDateLocal": "2023-10-10T10:00:00", "elapsedTimeInSeconds": 300, "distanceInMeter": 1500, "averagePower": 250.5, "averageHeartRate": 150, "maxHeartRate": 172, "rank": 2 } ]}The Authorization header was missing, malformed, or did not match the configured key.
Media typeapplication/json
Every error uses this shape.
object
error
required
A stable, machine readable code.
string
message
required
string
Examples
ExampleinvalidToken
{ "error": "invalid_token", "message": "A valid token is required. Send it in the Authorization header as a Bearer token."}Headers
Section titled “Headers”WWW-Authenticate
string
No activity with this identifier exists.
Media typeapplication/json
Every error uses this shape.
object
error
required
A stable, machine readable code.
string
message
required
string
Examples
ExampleunknownActivity
{ "error": "not_found", "message": "Activity \"activity-1\" not found"}