Skip to content

Latest commit

 

History

History
143 lines (127 loc) · 9.81 KB

README.md

File metadata and controls

143 lines (127 loc) · 9.81 KB

Rust API client for swagger

The Swagger Playground is the easiest way to familiarize yourself with the Strava API by submitting HTTP requests and observing the responses before you write any client code. It will show what a response will look like with different endpoints depending on the authorization scope you receive from your athletes. To use the Playground, go to https://www.strava.com/settings/api and change your “Authorization Callback Domain” to developers.strava.com. Please note, we only support Swagger 2.0. There is a known issue where you can only select one scope at a time. For more information, please check the section “client code” at https://developers.strava.com/docs.

Overview

This API client was generated by the swagger-codegen project. By using the swagger-spec from a remote server, you can easily generate an API client.

  • Strava API version: 3.0.0
  • Package version: 0.1.0

Documentation for API Endpoints

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

Class Method HTTP request Description
ActivitiesApi create_activity Post /activities Create an Activity
ActivitiesApi get_activity_by_id Get /activities/{id} Get Activity
ActivitiesApi get_comments_by_activity_id Get /activities/{id}/comments List Activity Comments
ActivitiesApi get_kudoers_by_activity_id Get /activities/{id}/kudos List Activity Kudoers
ActivitiesApi get_laps_by_activity_id Get /activities/{id}/laps List Activity Laps
ActivitiesApi get_logged_in_athlete_activities Get /athlete/activities List Athlete Activities
ActivitiesApi get_zones_by_activity_id Get /activities/{id}/zones Get Activity Zones
ActivitiesApi update_activity_by_id Put /activities/{id} Update Activity
AthletesApi get_logged_in_athlete Get /athlete Get Authenticated Athlete
AthletesApi get_logged_in_athlete_zones Get /athlete/zones Get Zones
AthletesApi get_stats Get /athletes/{id}/stats Get Athlete Stats
AthletesApi update_logged_in_athlete Put /athlete Update Athlete
ClubsApi get_club_activities_by_id Get /clubs/{id}/activities List Club Activities
ClubsApi get_club_admins_by_id Get /clubs/{id}/admins List Club Administrators
ClubsApi get_club_by_id Get /clubs/{id} Get Club
ClubsApi get_club_members_by_id Get /clubs/{id}/members List Club Members
ClubsApi get_logged_in_athlete_clubs Get /athlete/clubs List Athlete Clubs
GearsApi get_gear_by_id Get /gear/{id} Get Equipment
RoutesApi get_route_as_gpx Get /routes/{id}/export_gpx Export Route GPX
RoutesApi get_route_as_tcx Get /routes/{id}/export_tcx Export Route TCX
RoutesApi get_route_by_id Get /routes/{id} Get Route
RoutesApi get_routes_by_athlete_id Get /athletes/{id}/routes List Athlete Routes
RunningRacesApi get_running_race_by_id Get /running_races/{id} Get Running Race
RunningRacesApi get_running_races Get /running_races List Running Races
SegmentEffortsApi get_efforts_by_segment_id Get /segment_efforts List Segment Efforts
SegmentEffortsApi get_segment_effort_by_id Get /segment_efforts/{id} Get Segment Effort
SegmentsApi explore_segments Get /segments/explore Explore segments
SegmentsApi get_logged_in_athlete_starred_segments Get /segments/starred List Starred Segments
SegmentsApi get_segment_by_id Get /segments/{id} Get Segment
SegmentsApi star_segment Put /segments/{id}/starred Star Segment
StreamsApi get_activity_streams Get /activities/{id}/streams Get Activity Streams
StreamsApi get_route_streams Get /routes/{id}/streams Get Route Streams
StreamsApi get_segment_effort_streams Get /segment_efforts/{id}/streams Get Segment Effort Streams
StreamsApi get_segment_streams Get /segments/{id}/streams Get Segment Streams
UploadsApi create_upload Post /uploads Upload Activity
UploadsApi get_upload_by_id Get /uploads/{uploadId} Get Upload

Documentation For Models

Documentation For Authorization

strava_oauth

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: https://www.strava.com/api/v3/oauth/authorize
  • Scopes:
  • read: Read public segments, public routes, public profile data, public posts, public events, club feeds, and leaderboards
  • read_all: Read private routes, private segments, and private events for the user
  • profile:read_all: Read all profile information even if the user has set their profile visibility to Followers or Only You
  • profile:write: Update the user's weight and Functional Threshold Power (FTP), and access to star or unstar segments on their behalf
  • activity:read: Read the user's activity data for activities that are visible to Everyone and Followers, excluding privacy zone data
  • activity:read_all: The same access as activity:read, plus privacy zone data and access to read the user's activities with visibility set to Only You
  • activity:write: Access to create manual activities and uploads, and access to edit any activities that are visible to the app, based on activity read access level

Example

	auth := context.WithValue(context.TODO(), sw.ContextAccessToken, "ACCESSTOKENSTRING")
    r, err := client.Service.Operation(auth, args)

Or via OAuth2 module to automatically refresh tokens and perform user authentication.

	import 	"golang.org/x/oauth2"

    / .. Perform OAuth2 round trip request and obtain a token .. //

    tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token)
	auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource)
    r, err := client.Service.Operation(auth, args)