cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

The Hub is now in read-only mode as we make improvements to the Hub experience. More information is available here.

problem when upload GPX file activity

tobisoft
Mt. Kenya

hello!

My name is Tobias and I have an app for cyclists in which I am implementing a functionality in which users can upload activities in GPX format to their account. I am testing the api service and I am having an error that I cannot remove. According to all the documentation I was looking at the file I am sending is correct but the api tells me that it is not correct. I’m sending you the details of the tests I’m doing to see if you can help me figure this out. I appreciate your help.
Have a good evening.
 
The call is:
--header 'Authorization: Bearer ....' \
--form 'activity_type="Ride"' \
--form 'name="Test Walk"' \
--form 'description="Test walk for cyclon"' \
--form 'trainer="0"' \
--form 'commute="0"' \
--form 'data_type="gpx"' \
--form 'file=@"ftYnBaTC2/strava.gpx"'
 
the file GPX to send:
<?xml version="1.0" encoding="UTF-8"?>
<gpx
creator="CyclonApp"
version="1.1"
<metadata>
<time>2023-10-15T10:44:36Z</time>
</metadata>
<trk>
<name>Bicicleta por la tarde</name>
<trkseg>
<trkpt lat="44.6402470" lon="7.6585860">
<ele>318.1</ele>
<time>2023-10-15T10:44:36Z</time>
</trkpt>
<trkpt lat="44.6401380" lon="7.6586280">
<ele>318.1</ele>
<time>2023-10-15T10:44:37Z</time>
</trkpt>
<trkpt lat="44.6401430" lon="7.6586300">
<ele>318.1</ele>
<time>2023-10-15T10:44:38Z</time>
</trkpt>
</trkseg>
</trk>
</gpx>
 
 
when verify the activity
{
"id": 10628767959,
"id_str": "10628767959",
"external_id": null,
"error": "Improperly formatted data. <a href=\"https://support.strava.com/hc/articles/216917967-Uploading-poorly-formatted-GPS-files\" target=\"_blank\">More Information</a>.",
"status": "There was an error processing your activity.",
"activity_id": null
}
 
help me!
thanks!
1 REPLY 1

SkippyVasquez
Moderator Moderator
Moderator

Hey Tobisoft,

Thanks for the post. Take a look at our doc on Uploading to Strava. You will be able to reference info around file formats.

 

Skippy
STRAVA | Developer Hub Team


Ready, Get Set, Go!

Welcome to the Community - here is your guide to help you get started!


Know how to use Community


Understand Community Settings