Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I would like to download not empty TCX file using web API.

I made the endpoint to download tcx by referring to the Web-API Reference.

However, when I download the tcx file, an empty tcx file with only the tcx structure is returned.

    => Reference: https://dev.fitbit.com/build/reference/web-api/activity/#get-activity-tcx

 

I would like to receive sample data like gps and heart rate and ask for advice on how to make this.

Please let me know if I've missed anything.

 

What I have checked is the below:

1. The Activity Log ID(logId) was verified with the Get Activity Log endpoint.

    => End point: https://api.fitbit.com/1/user/-/activities/list.json

 

2. Target Log ID(logId) is 37096058634, 37106066455, 37505865993.

 

3. The TCX file for the above ID was requested as an Get Activity TCX endpoint.

    => End point: https://api.fitbit.com/1/user/-/activities/{logId}.tcx

    => Header: Authorization(Bearer {access_token})

 

4. A TCX file was returned in XML format, and the returned value was the same value except for datetime.

 

 

Return data example(xml):

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TrainingCenterDatabase xmlns="http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2">
    <Activities>
        <Activity Sport="Running">
            <Id>2021-02-09T22:31:03.000+09:00</Id>
            <Creator xsi:type="Device_t" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <UnitId>0</UnitId>
                <ProductID>0</ProductID>
            </Creator>
        </Activity>
    </Activities>
</TrainingCenterDatabase>

 

 

Thanks.

Daniel Jeong.

Best Answer
0 Votes
3 REPLIES 3

Hi @SunsetRunner 

 

The Get Activity TCX endpoint is intended to return GPS data in the response.  Therefore, the default setting for query parameter is includePartialTCX=false.  For recorded exercises that do not contain GPS data that were either manually logged, auto detected, coming from a 3rd party application or recorded on a Fitbit device that does not support GPS, you'll need to use query parameter includePartialTCX=true to receive a response.

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer

Hi @GordonFitbit

 

I appreciate your quick support.

 

I understand that Get Activity TCX Endpoint is the endpoint for returning GPS data.

And I understood that records without GPS data must use a specific query parameter (includePartialTCX=true) and that records that contain data in the TCX file by using this parameter mean data without GPS data.

 

No GPS data cases:
1. Manual recording without GPS data, or
2. automatically detected, or
3. Imported from a third-party application, or
4. For workout records that do not include GPS data recorded on a non-GPS fitbit device.

 

I'd like to ask again if my understanding is correct.

And I wonder how to make user should record activity data including GPS data.

 

Thanks,

@SunsetRunner 

Best Answer
0 Votes

Hi @SunsetRunner 

 

Those scenarios sound correct to me.   You cannot force people to provide the GPS data to your application.   However, I suppose you post a message that states "For the best experience, we recommend you record all exercises using the exercise application on a GPS supported Fitbit device and enable the location scope when authorizing our application to your Fitbit data." 

 

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes