Skip to main content

Good morning,
I have a question about activity upload via api.

I have a TCX file built manually, thus not coming from a device like Garmin. This file contains elevation data (<AltitudeMeters>...</AltitudeMeters>).

If I try to upload this activity via api (https://www.strava.com/api/v3/uploads), the activity appears among my activities (https://www.strava.com/athlete/training), but shows an elevation of 0.

Using the web interface (+ >> Upload activity >> Choose file):
1) before clicking Save & View, the activity appears among my activities, without elevation
2) after clicking Save & View, the elevation appears and is correct.

It seems like the api call stops at step 1, and the elevation is missing. Is it possible to obtain the same result (steps 1 and 2) using apis? 

You can force/suggest Strava to use your elevation data by setting the right device type in the TCX file. See the section Device and Elevation Data on https://developers.strava.com/docs/uploads/


You might need to add a namespaced attribute to the Creator

<Creator xsi:type="Device_t">
<Name>something with Barometer</Name>
</Creator>

Otherwise somebody from Strava might want to give their 2 cents.


I've the same problem, tried:

<Creator>
<Name>My Awesome Device with barometer</Name>
</Creator>

And:

<Creator xsi:type="Device_t">
<Name>something with Barometer</Name>
</Creator>

And: (which is the correct way according to https://www8.garmin.com/xmlschemas/TrainingCenterDatabasev2.xsd)

<Creator xsi:type="Device_t">
<Name>something with barometer</Name>
<UnitId>1234567890</UnitId>
<ProductID>123</ProductID>
<Version>
<VersionMajor>0</VersionMajor>
<VersionMinor>1</VersionMinor>
<BuildMajor>1</BuildMajor>
<BuildMinor>0</BuildMinor>
</Version>
</Creator>

The activity gets uploaded but with no elevation. Same TCX uploaded from the web interface shows the correct elevation.


Sorry, then I'm out of options. Hopefully somebody from Strava can give an answer then.


There was a similar thread to this in the Strava API google group. Maybe something in there would be useful?

https://groups.google.com/g/strava-api/c/3QreDD1EWjQ/m/rCxRQ1ghAwAJ


Reply