Strava v1.0.0 Strava.Athletes View Source

API calls for all endpoints tagged Athletes.

Link to this section Summary

Functions

Get Authenticated Athlete Returns the currently authenticated athlete. Tokens with profile:read_all scope will receive a detailed athlete representation; all others will receive a summary representation

Update Athlete Update the currently authenticated athlete. Requires profile:write scope

Link to this section Functions

Link to this function

get_logged_in_athlete(client) View Source
get_logged_in_athlete(Tesla.Env.client()) ::
  {:ok, Strava.DetailedAthlete.t()} | {:error, Tesla.Env.t()}

Get Authenticated Athlete Returns the currently authenticated athlete. Tokens with profile:read_all scope will receive a detailed athlete representation; all others will receive a summary representation.

Parameters

  • client (Strava.Client): Client to make authenticated requests

Returns

{:ok, %Strava.DetailedAthlete{}} on success {:error, info} on failure

Link to this function

get_logged_in_athlete_zones(client) View Source
get_logged_in_athlete_zones(Tesla.Env.client()) ::
  {:ok, Strava.Zones.t()} | {:error, Tesla.Env.t()}

Get Zones

Returns the the authenticated athlete's heart rate and power zones. Requires profile:read_all.

Parameters

  • client (Strava.Client): Client to make authenticated requests

Returns

{:ok, %Strava.Zones{}} on success {:error, info} on failure

Link to this function

get_stats(client, id, opts \\ []) View Source
get_stats(Tesla.Env.client(), integer(), keyword()) ::
  {:ok, Strava.ActivityStats.t()} | {:error, Tesla.Env.t()}

Get Athlete Stats

Returns the activity stats of an athlete.

Parameters

  • client (Strava.Client): Client to make authenticated requests
  • id (integer()): The identifier of the athlete. Must match the authenticated athlete.
  • opts (KeywordList): [optional] Optional parameters

    • :page (integer()): Page number.
    • :per_page (integer()): Number of items per page. Defaults to 30.

Returns

{:ok, %Strava.ActivityStats{}} on success {:error, info} on failure

Link to this function

update_logged_in_athlete(client, weight) View Source
update_logged_in_athlete(Tesla.Env.client(), float()) ::
  {:ok, Strava.DetailedAthlete.t()} | {:error, Tesla.Env.t()}

Update Athlete Update the currently authenticated athlete. Requires profile:write scope.

Parameters

  • client (Strava.Client): Client to make authenticated requests
  • weight (float()): The weight of the athlete in kilograms.

Returns

{:ok, %Strava.DetailedAthlete{}} on success {:error, info} on failure