Skip to main content
Question

api gpx upload

  • March 31, 2024
  • 3 replies
  • 53 views

Forum|alt.badge.img+2

I am making an app for the ios environment.
The app supports Strava upload in gpx format.
Most of the items you want are uploaded normally.
However, Strava's Sport items will not be sent as desired.
Below is an example.
let params = [
"name": StravaGPX_TitleName,
"type": "(Sport[userData.Sport_Name])",
"sport_type": Sport[userData.Sport_Name].trimmingCharacters(in: .whitespaces),
"description": "Uploaded from Masil-Tracker",
"data_type": "gpx"
]

Among the above
"type": "Mountain Bike Ride"
"type": "MountainBikeRide"
"sport_type": "Mountain Bike Ride"
"sport_type": "MountainBikeRide"

Even if you specify each one
The Sport item on the Strava is saved as "Ride".

Which code should I use to upload Strava gpx
Will the items you want be designated in Strava's Sport items?

3 replies

Jan_Mantau
Superuser
Forum|alt.badge.img+27
  • Superuser
  • March 31, 2024

There is a weird character at the start of your values. The correct values should be:

"type" : "Ride", "sport_type" : "MountainBikeRide"


Forum|alt.badge.img+2
  • Author
  • Hub Rookie
  • March 31, 2024

let params = [

            "name": StravaGPX_TitleName,

            "type": Sport[userData.Sport_Name],

            "sport_type": Sport[userData.Sport_Name].trimmingCharacters(in: .whitespaces),

            "description":"Uploaded from Masil-Tracker",

            "data_type":"gpx"

        ] 

The code above is exactly what I use.
Sport[userData.Sport_Name] 변수는
String "Mountain Bike Ride".

When uploading the Strava, it is still Ride in the Sport item.


Forum|alt.badge.img+2
  • Author
  • Hub Rookie
  • April 1, 2024

let params = [

            "name": StravaGPX_TitleName,

            "type": Sport[userData.Sport_Name],

            "sport_type": Sport[userData.Sport_Name].trimmingCharacters(in: .whitespaces),

            "description":"Uploaded from Masil-Tracker",

            "data_type":"gpx"

        ] 

The code above is exactly what I use.
Sport[userData.Sport_Name] 변수는
String "Mountain Bike Ride".

When uploading the Strava, it is still Ride in the Sport item.