Skip to content

Latest commit

 

History

History
306 lines (202 loc) · 11.9 KB

ActivitiesApi.md

File metadata and controls

306 lines (202 loc) · 11.9 KB

\ActivitiesApi

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

Method HTTP request Description
create_activity Post /activities Create an Activity
get_activity_by_id Get /activities/{id} Get Activity
get_comments_by_activity_id Get /activities/{id}/comments List Activity Comments
get_kudoers_by_activity_id Get /activities/{id}/kudos List Activity Kudoers
get_laps_by_activity_id Get /activities/{id}/laps List Activity Laps
get_logged_in_athlete_activities Get /athlete/activities List Athlete Activities
get_zones_by_activity_id Get /activities/{id}/zones Get Activity Zones
update_activity_by_id Put /activities/{id} Update Activity

create_activity

::models::DetailedActivity create_activity(ctx, name, _type, start_date_local, elapsed_time, optional) Create an Activity

Creates a manual activity for an athlete, requires activity:write scope.

Required Parameters

Name Type Description Notes
ctx context.Context context containing the authentication nil if no authentication
name String The name of the activity.
_type String Type of activity. For example - Run, Ride etc.
start_date_local String ISO 8601 formatted date time.
elapsed_time i32 In seconds.
optional map[string]interface{} optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a map[string]interface{}.

Name Type Description Notes
name String The name of the activity.
_type String Type of activity. For example - Run, Ride etc.
start_date_local String ISO 8601 formatted date time.
elapsed_time i32 In seconds.
description String Description of the activity.
distance f32 In meters.
trainer i32 Set to 1 to mark as a trainer activity.
commute i32 Set to 1 to mark as commute.

Return type

::models::DetailedActivity

Authorization

strava_oauth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_activity_by_id

::models::DetailedActivity get_activity_by_id(ctx, id, optional) Get Activity

Returns the given activity that is owned by the authenticated athlete. Requires activity:read for Everyone and Followers activities. Requires activity:read_all for Only Me activities.

Required Parameters

Name Type Description Notes
ctx context.Context context containing the authentication nil if no authentication
id i64 The identifier of the activity.
optional map[string]interface{} optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a map[string]interface{}.

Name Type Description Notes
id i64 The identifier of the activity.
include_all_efforts bool To include all segments efforts.

Return type

::models::DetailedActivity

Authorization

strava_oauth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_comments_by_activity_id

Vec<::models::Comment> get_comments_by_activity_id(ctx, id, optional) List Activity Comments

Returns the comments on the given activity. Requires activity:read for Everyone and Followers activities. Requires activity:read_all for Only Me activities.

Required Parameters

Name Type Description Notes
ctx context.Context context containing the authentication nil if no authentication
id i64 The identifier of the activity.
optional map[string]interface{} optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a map[string]interface{}.

Name Type Description Notes
id i64 The identifier of the activity.
page i32 Page number. Defaults to 1.
per_page i32 Number of items per page. Defaults to 30. [default to 30]

Return type

Vec<::models::Comment>

Authorization

strava_oauth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_kudoers_by_activity_id

Vec<::models::SummaryAthlete> get_kudoers_by_activity_id(ctx, id, optional) List Activity Kudoers

Returns the athletes who kudoed an activity identified by an identifier. Requires activity:read for Everyone and Followers activities. Requires activity:read_all for Only Me activities.

Required Parameters

Name Type Description Notes
ctx context.Context context containing the authentication nil if no authentication
id i64 The identifier of the activity.
optional map[string]interface{} optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a map[string]interface{}.

Name Type Description Notes
id i64 The identifier of the activity.
page i32 Page number. Defaults to 1.
per_page i32 Number of items per page. Defaults to 30. [default to 30]

Return type

Vec<::models::SummaryAthlete>

Authorization

strava_oauth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_laps_by_activity_id

Vec<::models::Lap> get_laps_by_activity_id(ctx, id) List Activity Laps

Returns the laps of an activity identified by an identifier. Requires activity:read for Everyone and Followers activities. Requires activity:read_all for Only Me activities.

Required Parameters

Name Type Description Notes
ctx context.Context context containing the authentication nil if no authentication
id i64 The identifier of the activity.

Return type

Vec<::models::Lap>

Authorization

strava_oauth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_logged_in_athlete_activities

Vec<::models::SummaryActivity> get_logged_in_athlete_activities(ctx, optional) List Athlete Activities

Returns the activities of an athlete for a specific identifier. Requires activity:read. Only Me activities will be filtered out unless requested by a token with activity:read_all.

Required Parameters

Name Type Description Notes
ctx context.Context context containing the authentication nil if no authentication
optional map[string]interface{} optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a map[string]interface{}.

Name Type Description Notes
before i32 An epoch timestamp to use for filtering activities that have taken place before a certain time.
after i32 An epoch timestamp to use for filtering activities that have taken place after a certain time.
page i32 Page number. Defaults to 1.
per_page i32 Number of items per page. Defaults to 30. [default to 30]

Return type

Vec<::models::SummaryActivity>

Authorization

strava_oauth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_zones_by_activity_id

Vec<::models::ActivityZone> get_zones_by_activity_id(ctx, id) Get Activity Zones

Summit Feature. Returns the zones of a given activity. Requires activity:read for Everyone and Followers activities. Requires activity:read_all for Only Me activities.

Required Parameters

Name Type Description Notes
ctx context.Context context containing the authentication nil if no authentication
id i32 The identifier of the activity.

Return type

Vec<::models::ActivityZone>

Authorization

strava_oauth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_activity_by_id

::models::DetailedActivity update_activity_by_id(ctx, id, optional) Update Activity

Updates the given activity that is owned by the authenticated athlete. Requires activity:write. Also requires activity:read_all in order to update Only Me activities

Required Parameters

Name Type Description Notes
ctx context.Context context containing the authentication nil if no authentication
id i64 The identifier of the activity.
optional map[string]interface{} optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a map[string]interface{}.

Name Type Description Notes
id i64 The identifier of the activity.
body UpdatableActivity

Return type

::models::DetailedActivity

Authorization

strava_oauth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]