Strava v1.0.0 Strava.Uploads View Source

API calls for all endpoints tagged Uploads.

Link to this section Summary

Functions

Upload Activity Uploads a new data file to create an activity from. Requires activity:write scope

Get Upload Returns an upload for a given identifier. Requires activity:write scope

Link to this section Functions

Link to this function

create_upload(client, opts \\ []) View Source
create_upload(Tesla.Env.client(), keyword()) ::
  {:ok, Strava.Upload.t()} | {:error, Tesla.Env.t()}

Upload Activity Uploads a new data file to create an activity from. Requires activity:write scope.

Parameters

  • client (Strava.Client): Client to make authenticated requests
  • opts (KeywordList): [optional] Optional parameters

    • :file (String.t): The uploaded file.
    • :name (String.t): The desired name of the resulting activity.
    • :description (String.t): The desired description of the resulting activity.
    • :trainer (String.t): Whether the resulting activity should be marked as having been performed on a trainer.
    • :commute (String.t): Whether the resulting activity should be tagged as a commute.
    • :data_type (String.t): The format of the uploaded file.
    • :external_id (String.t): The desired external identifier of the resulting activity.

Returns

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

Link to this function

get_upload_by_id(client, upload_id, opts \\ []) View Source
get_upload_by_id(Tesla.Env.client(), integer(), keyword()) ::
  {:ok, Strava.Upload.t()} | {:error, Tesla.Env.t()}

Get Upload Returns an upload for a given identifier. Requires activity:write scope.

Parameters

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

Returns

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