Strava API
This C# SDK is automatically generated by the Swagger Codegen project:
- API version: 3.0.0
- SDK version: 1.0.0
- Build date: 2018-11-25T08:47:13.749-08:00
- Build package: io.swagger.codegen.languages.CsharpDotNet2ClientCodegen
- .NET Standard 2.0
- .NET SDK 2.1
- Newtonsoft.Json.11.0.2
- RestSharp.Net2.1.1.11
Note: NuGet is downloaded by the mono compilation script and packages are installed with it. No dependency DLLs are bundled with this generator
Run the following command to generate the DLL
dotnet build
Then include the DLL (under the bin
folder) in the C# project, and use the namespaces:
using Strava.NET.Api;
using Strava.NET.Client;
using Strava.NET.Model;
using System;
using System.Diagnostics;
using Strava.NET.Api;
using Strava.NET.Client;
using Strava.NET.Model;
namespace Example
{
public class Example
{
public void main()
{
// Configure OAuth2 access token for authorization: strava_oauth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new ActivitiesApi();
var name = name_example; // string | The name of the activity.
var type = type_example; // string | Type of activity. For example - Run, Ride etc.
var startDateLocal = startDateLocal_example; // string | ISO 8601 formatted date time.
var elapsedTime = 56; // int? | In seconds.
var description = description_example; // string | Description of the activity. (optional)
var distance = 3.4; // float? | In meters. (optional)
var trainer = 56; // int? | Set to 1 to mark as a trainer activity. (optional)
var photoIds = photoIds_example; // string | List of native photo ids to attach to the activity. (optional)
var commute = 56; // int? | Set to 1 to mark as commute. (optional)
try
{
// Create an Activity
DetailedActivity result = apiInstance.CreateActivity(name, type, startDateLocal, elapsedTime, description, distance, trainer, photoIds, commute);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling ActivitiesApi.CreateActivity: " + e.Message );
}
}
}
}
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 |
- Strava.NET.Model.ActivityStats
- Strava.NET.Model.ActivityTotal
- Strava.NET.Model.ActivityType
- Strava.NET.Model.ActivityZone
- Strava.NET.Model.BaseStream
- Strava.NET.Model.Comment
- Strava.NET.Model.Error
- Strava.NET.Model.ExplorerResponse
- Strava.NET.Model.ExplorerSegment
- Strava.NET.Model.Fault
- Strava.NET.Model.HeartRateZoneRanges
- Strava.NET.Model.Lap
- Strava.NET.Model.LatLng
- Strava.NET.Model.MetaActivity
- Strava.NET.Model.MetaAthlete
- Strava.NET.Model.MetaClub
- Strava.NET.Model.PhotosSummary
- Strava.NET.Model.PhotosSummaryPrimary
- Strava.NET.Model.PolylineMap
- Strava.NET.Model.PowerZoneRanges
- Strava.NET.Model.Route
- Strava.NET.Model.RouteDirection
- Strava.NET.Model.RunningRace
- Strava.NET.Model.SegmentLeaderboard
- Strava.NET.Model.SegmentLeaderboardEntry
- Strava.NET.Model.Split
- Strava.NET.Model.StreamSet
- Strava.NET.Model.SummaryGear
- Strava.NET.Model.SummarySegment
- Strava.NET.Model.SummarySegmentEffort
- Strava.NET.Model.TimedZoneDistribution
- Strava.NET.Model.UpdatableActivity
- Strava.NET.Model.Upload
- Strava.NET.Model.ZoneRange
- Strava.NET.Model.ZoneRanges
- Strava.NET.Model.Zones
- Strava.NET.Model.AltitudeStream
- Strava.NET.Model.CadenceStream
- Strava.NET.Model.DetailedGear
- Strava.NET.Model.DetailedSegment
- Strava.NET.Model.DetailedSegmentEffort
- Strava.NET.Model.DistanceStream
- Strava.NET.Model.HeartrateStream
- Strava.NET.Model.LatLngStream
- Strava.NET.Model.MovingStream
- Strava.NET.Model.PowerStream
- Strava.NET.Model.SmoothGradeStream
- Strava.NET.Model.SmoothVelocityStream
- Strava.NET.Model.SummaryActivity
- Strava.NET.Model.SummaryAthlete
- Strava.NET.Model.SummaryClub
- Strava.NET.Model.TemperatureStream
- Strava.NET.Model.TimeStream
- Strava.NET.Model.TimedZoneRange
- Strava.NET.Model.DetailedActivity
- Strava.NET.Model.DetailedAthlete
- Strava.NET.Model.DetailedClub
- 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