strava

How to upload a run to a Strava athlete's profile using Alamofire

蓝咒 提交于 2021-02-08 05:38:16
问题 I'm trying to add functionality into an app that would allow a user to upload runs to their Strava profile. Currently the runs are stored in the Documents directory of the app as gpx files, and although I know how to access them, I'm having trouble with the syntax of the Alamofire request. My code looks like this: func getDocumentsDirectory() -> URL { let paths = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask) let documentsDirectory = paths[0] do { let fileURLs = try

How to convert Strava zone data to something familiar

北战南征 提交于 2021-01-29 11:25:16
问题 I'm trying to figure out how to convert the pace from the Strava API (zones). Would be nice to have it in kph or mins per km. Thanks in advance Sample response: { "score": 8, "distribution_buckets": [ { "max": 2.612871112678786, "min": 0, "time": 450 }, { "max": 3.0355414397297658, "min": 2.612871112678786, "time": 582 }, { "max": 3.38136261640784, "min": 3.0355414397297658, "time": 579 }, { "max": 3.6119100675265563, "min": 3.38136261640784, "time": 542 }, { "max": 3.842457518645273, "min":

swagger_client in python trying to use Strava API

依然范特西╮ 提交于 2020-03-05 05:30:08
问题 I am trying to use the Stava API in a Flask project. I have seen the following stackoverflow and installed swagger_client swagger-codegen generate -i https://developers.strava.com/swagger/swagger.json -l python -o ./StravaPythonClient as per their instructions. However when i run the app i still get import swagger_client ModuleNotFoundError: No module named 'swagger_client' My code is here import swagger_client from swagger_client.rest import ApiException from pprint import pprint # Configure

swagger_client in python trying to use Strava API

拟墨画扇 提交于 2020-03-05 05:29:05
问题 I am trying to use the Stava API in a Flask project. I have seen the following stackoverflow and installed swagger_client swagger-codegen generate -i https://developers.strava.com/swagger/swagger.json -l python -o ./StravaPythonClient as per their instructions. However when i run the app i still get import swagger_client ModuleNotFoundError: No module named 'swagger_client' My code is here import swagger_client from swagger_client.rest import ApiException from pprint import pprint # Configure

Even if client id is correct its giving invalid client_id message in authorize callback

喜夏-厌秋 提交于 2019-12-13 17:14:18
问题 Issue I am using this library to do OAuth with Strava. It works fine till redirecting a user to the authentication page of Strava but the issue comes once the user approves the application. In error, it says that client_id is invalid but actually it isn't because 1) I double checked 2) If that's the case then it should give an error when opening authentication page but it didn't. I don't know what is the best way to debug the error. I tried setting up debugger in Xcode but it didn't work as I

Problems with __future__ and swagger_client in Python

女生的网名这么多〃 提交于 2019-12-08 12:43:37
问题 The Strava API documentation gives the following sample code which I copied and entered my own access token and club ID: from __future__ import print_statement import time import swagger_client from swagger_client.rest import ApiException from pprint import pprint # Configure OAuth2 access token for authorization: strava_oauth swagger_client.configuration.access_token = 'MY_ACCESS_TOKEN' # create an instance of the API class api_instance = swagger_client.ClubsApi() id = MY_CLUB_ID # Integer |

Problem with access token in Strava API v3 GET all athlete activities

拟墨画扇 提交于 2019-12-06 19:50:30
问题 I am having trouble accessing all athlete activities (my own) from the url in Strava's api documentation. I am able to get my own year-to-date stats: https://www.strava.com/api/v3/athletes/XXXXXXXX/stats?access_token=ACCESSTOKEN I am able to get my profile information: https://www.strava.com/api/v3/athlete?access_token=ACCESSTOKEN But when I try to get all my activities: https://www.strava.com/api/v3/athlete/activities?access_token=ACCESSTOKEN I receive the following error: { "message":

Problem with access token in Strava API v3 GET all athlete activities

寵の児 提交于 2019-12-05 01:31:11
I am having trouble accessing all athlete activities (my own) from the url in Strava's api documentation. I am able to get my own year-to-date stats: https://www.strava.com/api/v3/athletes/XXXXXXXX/stats?access_token=ACCESSTOKEN I am able to get my profile information: https://www.strava.com/api/v3/athlete?access_token=ACCESSTOKEN But when I try to get all my activities: https://www.strava.com/api/v3/athlete/activities?access_token=ACCESSTOKEN I receive the following error: { "message": "Authorization Error", "errors": [ { "resource": "AccessToken", "field": "activity:read_permission", "code":