All URIs are relative to https://www.strava.com/api/v3
Method | HTTP request | Description |
---|---|---|
GetLoggedInAthlete | Get /athlete | Get Authenticated Athlete |
GetLoggedInAthleteZones | Get /athlete/zones | Get Zones |
GetStats | Get /athletes/{id}/stats | Get Athlete Stats |
UpdateLoggedInAthlete | Put /athlete | Update Athlete |
DetailedAthlete GetLoggedInAthlete(ctx).Execute()
Get Authenticated Athlete
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/stevenpelley/strava3golang"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AthletesAPI.GetLoggedInAthlete(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AthletesAPI.GetLoggedInAthlete``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetLoggedInAthlete`: DetailedAthlete
fmt.Fprintf(os.Stdout, "Response from `AthletesAPI.GetLoggedInAthlete`: %v\n", resp)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiGetLoggedInAthleteRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Zones GetLoggedInAthleteZones(ctx).Execute()
Get Zones
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/stevenpelley/strava3golang"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AthletesAPI.GetLoggedInAthleteZones(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AthletesAPI.GetLoggedInAthleteZones``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetLoggedInAthleteZones`: Zones
fmt.Fprintf(os.Stdout, "Response from `AthletesAPI.GetLoggedInAthleteZones`: %v\n", resp)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiGetLoggedInAthleteZonesRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ActivityStats GetStats(ctx, id).Execute()
Get Athlete Stats
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/stevenpelley/strava3golang"
)
func main() {
id := int64(789) // int64 | The identifier of the athlete. Must match the authenticated athlete.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AthletesAPI.GetStats(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AthletesAPI.GetStats``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetStats`: ActivityStats
fmt.Fprintf(os.Stdout, "Response from `AthletesAPI.GetStats`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | int64 | The identifier of the athlete. Must match the authenticated athlete. |
Other parameters are passed through a pointer to a apiGetStatsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DetailedAthlete UpdateLoggedInAthlete(ctx, weight).Execute()
Update Athlete
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/stevenpelley/strava3golang"
)
func main() {
weight := float32(3.4) // float32 | The weight of the athlete in kilograms.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AthletesAPI.UpdateLoggedInAthlete(context.Background(), weight).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AthletesAPI.UpdateLoggedInAthlete``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateLoggedInAthlete`: DetailedAthlete
fmt.Fprintf(os.Stdout, "Response from `AthletesAPI.UpdateLoggedInAthlete`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
weight | float32 | The weight of the athlete in kilograms. |
Other parameters are passed through a pointer to a apiUpdateLoggedInAthleteRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]