# README
Go API client for strava
Strava API
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.
- API version: 3.0.0
- Package version: 1.0.0
- Build package: io.swagger.codegen.languages.GoClientCodegen
Installation
Put the package under your project folder and add the following in import:
"./strava"
Documentation for API Endpoints
All URIs are relative to https://www.strava.com/api/v3
Class | Method | HTTP request | Description |
---|---|---|---|
ActivitiesApi | CreateActivity | Post /activities | Create an Activity |
ActivitiesApi | GetActivityById | Get /activities/{id} | Get Activity |
ActivitiesApi | GetCommentsByActivityId | Get /activities/{id}/comments | List Activity Comments |
ActivitiesApi | GetKudoersByActivityId | Get /activities/{id}/kudos | List Activity Kudoers |
ActivitiesApi | GetLapsByActivityId | Get /activities/{id}/laps | List Activity Laps |
ActivitiesApi | GetLoggedInAthleteActivities | Get /athlete/activities | List Athlete Activities |
ActivitiesApi | GetZonesByActivityId | Get /activities/{id}/zones | Get Activity Zones |
ActivitiesApi | UpdateActivityById | Put /activities/{id} | Update Activity |
AthletesApi | GetLoggedInAthlete | Get /athlete | Get Authenticated Athlete |
AthletesApi | GetLoggedInAthleteZones | Get /athlete/zones | Get Zones |
AthletesApi | GetStats | Get /athletes/{id}/stats | Get Athlete Stats |
AthletesApi | UpdateLoggedInAthlete | Put /athlete | Update Athlete |
ClubsApi | GetClubActivitiesById | Get /clubs/{id}/activities | List Club Activities |
ClubsApi | GetClubAdminsById | Get /clubs/{id}/admins | List Club Administrators. |
ClubsApi | GetClubById | Get /clubs/{id} | Get Club |
ClubsApi | GetClubMembersById | Get /clubs/{id}/members | List Club Members |
ClubsApi | GetLoggedInAthleteClubs | Get /athlete/clubs | List Athlete Clubs |
GearsApi | GetGearById | Get /gear/{id} | Get Equipment |
RoutesApi | GetRouteAsGPX | Get /routes/{id}/export_gpx | Export Route GPX |
RoutesApi | GetRouteAsTCX | Get /routes/{id}/export_tcx | Export Route TCX |
RoutesApi | GetRouteById | Get /routes/{id} | Get Route |
RoutesApi | GetRoutesByAthleteId | Get /athletes/{id}/routes | List Athlete Routes |
RunningRacesApi | GetRunningRaceById | Get /running_races/{id} | Get Running Race |
RunningRacesApi | GetRunningRaces | Get /running_races | List Running Races |
SegmentEffortsApi | GetEffortsBySegmentId | Get /segments/{id}/all_efforts | List Segment Efforts |
SegmentEffortsApi | GetSegmentEffortById | Get /segment_efforts/{id} | Get Segment Effort |
SegmentsApi | ExploreSegments | Get /segments/explore | Explore segments |
SegmentsApi | GetLeaderboardBySegmentId | Get /segments/{id}/leaderboard | Get Segment Leaderboard |
SegmentsApi | GetLoggedInAthleteStarredSegments | Get /segments/starred | List Starred Segments |
SegmentsApi | GetSegmentById | Get /segments/{id} | Get Segment |
SegmentsApi | StarSegment | Put /segments/{id}/starred | Star Segment |
StreamsApi | GetActivityStreams | Get /activities/{id}/streams | Get Activity Streams |
StreamsApi | GetSegmentEffortStreams | Get /segment_efforts/{id}/streams | Get segment effort streams |
StreamsApi | GetSegmentStreams | Get /segments/{id}/streams | Get Segment Streams |
UploadsApi | CreateUpload | Post /uploads | Upload Activity |
UploadsApi | GetUploadById | Get /uploads/{uploadId} | Get Upload |
Documentation For Models
- ActivityStats
- ActivityTotal
- ActivityType
- ActivityZone
- BaseStream
- Comment
- ExplorerResponse
- ExplorerSegment
- Fault
- HeartRateZoneRanges
- Lap
- LatLng
- MetaActivity
- MetaAthlete
- MetaClub
- ModelError
- PhotosSummary
- PhotosSummaryPrimary
- PolylineMap
- PowerZoneRanges
- Route
- RouteDirection
- RunningRace
- SegmentLeaderboard
- SegmentLeaderboardEntry
- Split
- StreamSet
- SummaryGear
- SummarySegment
- SummarySegmentEffort
- TimedZoneDistribution
- UpdatableActivity
- Upload
- ZoneRange
- ZoneRanges
- Zones
- AltitudeStream
- CadenceStream
- DetailedGear
- DetailedSegment
- DetailedSegmentEffort
- DistanceStream
- HeartrateStream
- LatLngStream
- MovingStream
- PowerStream
- SmoothGradeStream
- SmoothVelocityStream
- SummaryActivity
- SummaryAthlete
- SummaryClub
- TemperatureStream
- TimeStream
- TimedZoneRange
- DetailedActivity
- DetailedAthlete
- DetailedClub
Documentation For Authorization
strava_oauth
- Type: OAuth
- Flow: accessCode
- Authorization URL: https://www.strava.com/api/v3/oauth/authorize
- Scopes:
- public: default, private activities are not returned, privacy zones are respected in stream requests
- view_private: View private activities and data within privacy zones
- write: Modify activities, upload on the user’s behalf
Example
auth := context.WithValue(context.Background(), 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)
Author
# Functions
CacheExpires helper function to determine remaining time before repeating a request.
NewAPIClient creates a new API client.
No description provided by the author
No description provided by the author
No description provided by the author
# Constants
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
List of ActivityType.
# Variables
ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAPIKey takes an APIKey as authentication for the request.
ContextBasicAuth takes BasicAuth as authentication for the request.
ContextOAuth2 takes a oauth2.TokenSource as authentication for the request.
# Structs
A set of rolled-up statistics and totals for an athlete.
A roll-up of metrics pertaining to a set of activities.
No description provided by the author
No description provided by the author
APIClient manages communication with the Strava API v3 API v3.0.0 In most cases there should be only one, shared, APIClient.
APIKey provides API key based authentication to a request passed via context using ContextAPIKey.
No description provided by the author
No description provided by the author
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth .
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Encapsulates the errors that may be returned from the API.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
.
No description provided by the author
A.
A row in a segment leaderboard.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Stores the exclusive ranges representing zones and the time spent in each.
A union type representing the time spent in a given zone.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
No description provided by the author
ActivityType : An enumeration of the types an activity may have.
No description provided by the author
No description provided by the author
No description provided by the author
A pair of latitude/longitude coordinates, represented as an array of 2 floating point numbers.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author