All URIs are relative to https://www.strava.com/api/v3
Method | HTTP request | Description |
---|---|---|
create_upload | POST /uploads | Upload Activity |
get_upload_by_id | GET /uploads/{uploadId} | Get Upload |
Upload create_upload(file=file, name=name, description=description, private=private, trainer=trainer, commute=commute, data_type=data_type, external_id=external_id)
Upload Activity
Uploads a new data file to create an activity from.
from __future__ import print_function
import time
import strava_api_v3
from strava_api_v3.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: strava_oauth
configuration = strava_api_v3.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = strava_api_v3.UploadsApi(strava_api_v3.ApiClient(configuration))
file = '/path/to/file.txt' # file | The uploaded file. (optional)
name = 'name_example' # str | The desired name of the resulting activity. (optional)
description = 'description_example' # str | The desired description of the resulting activity. (optional)
private = 56 # int | Whether the resulting activity should be private. (optional)
trainer = 'trainer_example' # str | Whether the resulting activity should be marked as having been performed on a trainer. (optional)
commute = 'commute_example' # str | Whether the resulting activity should be tagged as a commute. (optional)
data_type = 'data_type_example' # str | The format of the uploaded file. (optional)
external_id = 'external_id_example' # str | The desired external identifier of the resulting activity. (optional)
try:
# Upload Activity
api_response = api_instance.create_upload(file=file, name=name, description=description, private=private, trainer=trainer, commute=commute, data_type=data_type, external_id=external_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling UploadsApi->create_upload: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
file | file | The uploaded file. | [optional] |
name | str | The desired name of the resulting activity. | [optional] |
description | str | The desired description of the resulting activity. | [optional] |
private | int | Whether the resulting activity should be private. | [optional] |
trainer | str | Whether the resulting activity should be marked as having been performed on a trainer. | [optional] |
commute | str | Whether the resulting activity should be tagged as a commute. | [optional] |
data_type | str | The format of the uploaded file. | [optional] |
external_id | str | The desired external identifier of the resulting activity. | [optional] |
- Content-Type: multipart/form-data
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Upload get_upload_by_id(upload_id)
Get Upload
Returns an upload for a given identifier.
from __future__ import print_function
import time
import strava_api_v3
from strava_api_v3.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: strava_oauth
configuration = strava_api_v3.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = strava_api_v3.UploadsApi(strava_api_v3.ApiClient(configuration))
upload_id = 789 # int | The identifier of the upload.
try:
# Get Upload
api_response = api_instance.get_upload_by_id(upload_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling UploadsApi->get_upload_by_id: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
upload_id | int | The identifier of the upload. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]