Nav button

API Description

An API to serve 3 key concepts for quantified self

planview

Main benefits

Global vision

Get started

API for quantified self and connected products : Sport activities, statistics & body measures

API conventions

All data is sent and received as JSONLD

Date format : 2013-03-09T16:39:53+00:00

Date filter : ?property[after|before|strictly_after|strictly_before]=value Example : createdAt[after]=2018-03-19

Country codes follow the is norme ISO 3166 with 2 char ( ex : FR)

Language codes follow the norme ISO 639-1 with 2 char ( ex : NL)

API Registration

Our self service developer portal is not yet ready. First contact infra@decathloncoach.com with information :

If we validate your application, you will receive :

Swagger

You can find a Swagger UI here.

Authentification

Sports Tracking Data is a ressource server, the identification and authorization role is assumed by Geonaute Account (it will be replaced during 2019 by Decathlon Login). Geonaute Account supports Oauth V2.

Flow supported :

To get a client ID, contact infra@decathloncoach.com

Login flow Authorization Code

Create a login button with this link:

https://account.geonaute.com/oauth/authorize?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=https://YOUR_REDIRECT_URL

After the user login, the user will be redirected to :

https://YOUR_REDIRECT_URL?code=XXXXXXXXXX

Collect the code on your server side and validate it. You will receive an access_token in return.

curl -X GET \
  'https://account.geonaute.com/oauth/accessToken?client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URL&client_secret=CLIENT_ID_SECRET&code=THE_USER_CODE&grant_type=authorization_code'

Answer

{
  'access_token' : 'XXXXXXXXX'
}

Get JWT bearer

With the Access token you could get a JWT bearer with a validity of 15 minutes. This bearer will be required for almost all API calls to Sports Tracking Data.

curl -X GET \
  'https://account.geonaute.com/api/me?access_token=ACCESS_TOKEN'

Answer

{
    "email": "arthur@dent.com",
    "firstName": "Arthur",
    "gender": "male",
    "birthdate": 631238400000,
    "lastName": "Dent",
    "created": 1469717300448,
    "ldid": "HERE_THE_UNIQ_ID_FOR_SPORTS_TRACKING_DATA",
    "requestKey": "HERE_THE_JWT_bearer"
}

JWT payload structure

{
  "iss": "account.geonaute.com",
  "exp": 1504793223,
  "iat": 1504789623,
  "ldid": "dfdc03c5bXXXX",
  "stack": "eu1",
  "firstname": "Arthur",
  "lastname": "Dent",
  "email": "arthur@dent.com",
  "gender": "Male",
  "birthdate": "1990-01-01",
  "country": "FR"
}

Note the ldid field which is the Sports Tracling Data identification. It will serve in a lot of api calls as parameter.

Main operations

The main API operations are :

The first call

GET https://api-eu.decathlon.net/sportstrackingdata/v2/me/

Curl

curl -X GET \
    https://api-eu.decathlon.net/sportstrackingdata/v2/me/ \
  -H 'Authorization: Bearer {your bearer}' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {your api key}' \

Sample answer

{
    "@context": "/v2/contexts/User",
    "@id": "/v2/users/ed3a20dfabaa09ae73f6",
    "@type": "User",
    "id": "ed3a20dfabaa09ae73f6",
    "oneId": null,
    "gender": 1,
    "roles": [
        "ROLE_USER"
    ],
    "language": "fr",
    "country": "BE",
    "imageUrl": "https://d1v3pubopekoj.cloudfront.net/prod/people/f0f31a5a71584076c6.png",
    "birthDate": "1984-07-27",
    "createdAt": "2013-03-09T16:39:53+00:00",
    "updatedAt": "2017-12-18T09:43:43+00:00",
    "scheduleDelete": null
}

Congratulations ! You executed your first request to know your basic settings of you user account. Now you will be able to add sport activities and get them by API.

Referentials

Sports Tracking Data supports many sports, many units to analyse sport activities and user's measures. To allow this, Sports Tracking Data uses a lot of abstraction. It permits to add a new sport or a new unit in a referential, then the new item is usable for everyone.

This is the list of the referentials :

Main referentials

Each time you refer to a sport, you have to indicate the ressource id which refers to the referential. Example, if you create a new sport activity for an user, you will indicate the sport "/v2/sports/121" which refers to the Running. In same manner, Datatype is the referential of each units and measures of Sports Data. Example : Distance, Duration, Speed Current, Speed average, Speed max, elevation, body weight, body height...

Main datatypes

Here we provide a top 25 extract from datatypes referencial used to give you a preview of the list.

Id unit label cumulable recordWay
99 Ons Points earned 1 1
24 s Duration 1 1
5 m Distance 1 1
23 kcal Calories burnt 1 1
9 m/h Speed avg 1
6 m/h Speed current 0
18 m Ascent 1 1
19 m Descent 1 1
16 m Elevation min 0
15 m Elevation max 1
14 m Elevation current 0
36 Mode 0
4 bpm HR avg 0
7 m/h Speed max 1
3 bpm HR max 1
1 bpm HR current 0
20 bool Lap 0
17 m Elevation avg 0
10 steps/min Cadence current 0
177 Bike trainer resistance 0
207 Avg Bike Trainer Resistance 0
206 Avg Bike Trainer Resistance 1
103 rpm RPM avg 1
101 rpm RPM max 0
100 rpm RPM current 0

Example with Sport referential

A referential is read only. If you have a request to add a new item please contact the support.

GET https://api-eu.decathlon.net/sportstrackingdata/v2/sports

Curl

curl -X GET \
    https://api-eu.decathlon.net/sportstrackingdata/v2/sports?active=1&page=1 \
  -H 'Authorization: Bearer {your bearer}' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {your api key}' \ 

Response

status 200 :  OK
{
    "@context": "/v2/contexts/Sport",
    "@id": "/v2/sports",
    "@type": "hydra:Collection",
    "hydra:member": [
        {
            "@id": "/v2/sports/7",
            "@type": "Sport",
            "id": 7,
            "translatedNames": {
                "de": "Gleitschirmfliegen",
                "en": "Paragliding",
                "es": "Parapente",
                "fr": "Parapente",
                "hu": "Siklóernyős",
                "it": "Parapendio",
                "nl": "Paragliding",
                "pl": "Paralotniarstwo",
                "pt": "Parapente",
                "ru": "Параплан",
                "zh": "滑翔伞"
            },
            "universe": "/v2/universes/1",
            "active": true,
            "createdAt": "2018-03-14T13:09:00+00:00",
            "updatedAt": "2018-08-10T04:00:07+00:00"
        },
        {
            "@id": "/v2/sports/10",
            "@type": "Sport",
            "id": 10,
            "translatedNames": {
                "de": "Basketball",
                "en": "Basketball",
                "es": "Baloncesto",
                "fr": "Basketball",
                "hu": "Kosárlabda",
                "it": "Basket",
                "nl": "Basketbal",
                "pl": "Koszykówka",
                "pt": "Basquetebol",
                "ru": "Баскетбол",
                "zh": "篮球"
            },
            "universe": "/v2/universes/2",
            "active": true,
            "createdAt": "2018-03-14T13:09:00+00:00",
            "updatedAt": "2018-08-10T04:00:07+00:00"
        },
        {
            "@id": "/v2/sports/13",
            "@type": "Sport",
            "id": 13,
            "translatedNames": {
                "de": "Fußball",
                "en": "Football",
                "es": "Fútbol",
                "fr": "Football",
                "hu": "Labdarúgás",
                "it": "Calcio",
                "nl": "Voetbal",
                "pl": "Piłka nożna",
                "pt": "Futebol",
                "ru": "Футбол",
                "zh": "足球"
            },
            "universe": "/v2/universes/2",
            "active": true,
            "createdAt": "2018-03-14T13:09:00+00:00",
            "updatedAt": "2018-08-10T04:00:08+00:00"
        },
        {
            "@id": "/v2/sports/18",
            "@type": "Sport",
            "id": 18,
            "translatedNames": {
                "de": "Handball",
                "en": "Handball",
                "es": "Balonmano",
                "fr": "Handball",
                "hu": "Kézilabda",
                "it": "Pallamano",
                "nl": "Handbal",
                "pl": "Piłka ręczna",
                "pt": "Andebol",
                "ru": "Гандбол",
                "zh": "手球"
            },
            "universe": "/v2/universes/2",
            "active": true,
            "createdAt": "2018-03-14T13:09:00+00:00",
            "updatedAt": "2018-08-10T04:00:08+00:00"
        },
        {
            "@id": "/v2/sports/20",
            "@type": "Sport",
            "id": 20,
            "translatedNames": {
                "de": "Hockey",
                "en": "Hockey",
                "es": "Hockey",
                "fr": "Hockey",
                "hu": "Jéghoki",
                "it": "Hockey",
                "nl": "Hockey",
                "pl": "Hokej",
                "pt": "Hóquei",
                "ru": "Хоккей",
                "zh": "曲棍球"
            },
            "universe": "/v2/universes/2",
            "active": true,
            "createdAt": "2018-03-14T13:09:00+00:00",
            "updatedAt": "2018-08-10T04:00:08+00:00"
        },
        ...
           ],
    "hydra:view": {
        "@id": "/v2/sports?active=1&page=1",
        "@type": "hydra:PartialCollectionView",
        "hydra:next": "/v2/sports?active=1&page=2"
    },
    "hydra:search": {
        "@type": "hydra:IriTemplate",
        "hydra:template": "/v2/sports{?active}",
        "hydra:variableRepresentation": "BasicRepresentation",
        "hydra:mapping": [
            {
                "@type": "IriTemplateMapping",
                "variable": "active",
                "property": "active",
                "required": false
            }
        ]
    }
}

status 4xx : Client errors, check response for details.

status 5xx : Server errors, check response for details.


Main sports list

Here we provide an extract from the sport referencial to give you a preview of the sports and their IDs.

Id Sport name
176 Alpine skiing
183 Alternative Nordic skiing
260 Aqua gym sessions
326 Archery
177 Back country skiing
335 Badminton
10 Basketball
381 Bicycle
360 BMX
264 Bodyboarding
35 Boxing
265 Canoeing and kayaking
161 Climbing
397 Cross trainer
404 Cross training
402 Daily activity
79 Dancing
91 Fitness
13 Football
320 Golf
18 Handball
168 Hiking
20 Hockey
401 Home Trainer
200 Horse riding
110 Indoor fitness bike
98 Indoor weight training
367 Inline skating
405 Jumping rope
273 Kite surfing
366 Land sailing
45 Martial arts
388 Mountain biking
153 Mountaineering
184 Nordic skating
114 Nordic walking
127 Orientation racing
340 Padel
7 Paragliding
109 Pilates
385 Road cycling
263 Rowing
398 Rowing machine
27 Rugby

Connected products referentials

These referentials are linked to the Decathlon connected products. They allow to manage the devices and get a traceability of the model and the firmwares used.

Other referentials

Create a device

To create a sport activity, you have two manners to declare it :

This page shows you how to create a new device for an user.

Request

POST https://api-eu.decathlon.net/sportstrackingdata/v2/user_devices

Request body

{
  "serial": "serialnumber123456",
  "model": "/v2/device_models/1",
  "firmware": "/v2/firmwares/1",
  "user": "/v2/users/{{user_id}}",
  "ownership": 0,
  "lastConnectedAt": "2018-04-16T16:05:11.896Z"
}

You will need to indicated some URI ressources to create a new device :

Curl

curl -X POST \
    https://api-eu.decathlon.net/sportstrackingdata/v2/user_devices \
  -H 'Authorization: Bearer {your bearer}' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {your api key}' \
  -d '{
  "serial": "serialnumber123456",
  "model": "/v2/device_models/1",
  "firmware": "/v2/firmwares/1",
  "user": "/v2/users/{{user_id}}",
  "ownership": 0,
  "lastConnectedAt": "2018-04-16T16:05:11.896Z"
  }' 

Response

status 201 : Created
{
    "@context": "/v2/contexts/UserDevice",
    "@id": "/v2/user_devices/eu271ed863164e25fb3d",
    "@type": "UserDevice",
    "id": "eu271ed863164e25fb3d",
    "serial": "serialnumber123456",
    "model": "/v2/device_models/1",
    "firmware": "/v2/firmwares/1",
    "user": "/v2/users/820d0XXXXXa7013969",
    "ownership": 0,
    "lastConnectedAt": "2018-04-16T16:05:11+00:00",
    "createdAt": "2018-08-17T09:35:13+00:00",
    "updatedAt": "2018-08-17T09:35:13+00:00"
}

status 4xx : Client errors, check response for details.

status 5xx : Server errors, check response for details.


Thank to the new device URI : "/v2/user_devices/eu271ed863164e25fb3d" you will be able to create a new sport activity linked to this device.

Please refer to the swagger to see how to list all devices for an user, how to update a device for example if the firmware is updated.

Serial number of the device

Generally, the serial come from :

We recommend these characters : a-z A-Z 0-9 -

Memo : why the device management is important

=> So it is important for troubleshooting when a problem occurs.

Retreive activities

Get the collection of activities.

Request

GET https://api-eu.decathlon.net/sportstrackingdata/v2/activities

Curl

curl -X GET \
    https://api-eu.decathlon.net/sportstrackingdata/v2/activities \
  -H 'Authorization: Bearer {your bearer}' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {your api key}' \

Response

status 200 : Ok
{
    "@context": "/v2/contexts/Activity",
    "@id": "/v2/activities",
    "@type": "hydra:Collection",
    "hydra:member": [
        {
            "@id": "/v2/activities/eu205bc29d9975f27cfb",
            "@type": "Activity",
            "id": "eu205bc29d9975f27cfb",
            "name": "Test V2 - Android - 21 juin 2018",
            "user": "/v2/users/ed3a20dfabaf09ae73f6",
            "sport": "/v2/sports/381",
            "userDevice": null,
            "startdate": "2018-06-21T09:36:03+02:00",
            "duration": 753,
            "latitude": null,
            "longitude": null,
            "elevation": null,
            "manual": true,
            "comment": null,
            "connector": null,
            "userSession": null,
            "correctedElevation": true,
            "images": [],
            "thumbnail": "https://linkdata-ressources-eu2.geonaute.com/prod/ed3a20dfabaf09ae73f6/maps/eu205bc29d9975f27cfb.png",
            "dataSummaries": {
                "5": 4127,
                "9": 19731,
                "15": 42,
                "16": 25,
                "18": 17,
                "19": 1,
                "23": 117,
                "24": 753,
                "97": 70,
                "99": 70
            },
            "tags": [],
            "trackFlag": true,
            "datastreamFlag": true,
            "globalChallenge": null,
            "availableDatatypes": [
                5,
                9,
                23,
                24,
                97,
                99,
                6,
                14
            ],
            "createdAt": "2018-06-21T08:35:36+00:00",
            "updatedAt": "2018-06-21T08:35:38+00:00"
        }
    ],
    "hydra:view": {
        "@id": "/v2/activities?limit=2&page=1",
        "@type": "hydra:PartialCollectionView",
        "hydra:next": "/v2/activities?limit=2&page=2"
    },
    "hydra:search": {
        "@type": "hydra:IriTemplate",
        "hydra:template": "/v2/activities{?user,user[]}",
        "hydra:variableRepresentation": "BasicRepresentation",
        "hydra:mapping": [
            {
                "@type": "IriTemplateMapping",
                "variable": "user",
                "property": "user",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "user[]",
                "property": "user",
                "required": false
            }
        ]
    }
}

status 4xx : Client errors, check response for details.

status 5xx : Server errors, check response for details.

Filters

You could apply many filter on this request, for example an interval of date, a sport id, ...

Add an activity

Add a sport activity to your account

Request

POST https://api-eu.decathlon.net/sportstrackingdata/v2/activities

Request Body

To construct the body of our activity, you will need to describe the activity, name, startdate and furnhish some nodes of data :

{
    "name":"My workout",
    "startdate":"2018-04-19T08:28:49+02:00",
    "duration":954,
    "user":"/v2/users/{{user_id}}",
    "sport":"/v2/sports/381",
    "connector":"/v2/connectors/702",
    "location":{
    "elapsed_time":0,
    "latitude":50.638437762,
    "longitude":3.125975041,
    "elevation":0,
    "device":{
        "firmware":59,
        "model":17,
        "sn":"androidapp-f72c681e8442049956db"
    },
    "manual":"false"
    },
    "dataSummaries":{
        "6":86927,
        "9":19227,
        "5":5095,
        "24":954
    },
    "datastream":{
        "0":{
            "5":0,
            "6":0,
            "36":0
        },
        "1":{
            "5":0,
            "6":20135,
            "36":0
        },
        "2":{
            "5":24,
            "6":86927,
            "36":0
        },
        "3":{
            "5":24,
            "6":86927,
            "36":0
        },
        "4":{
            "5":32,
            "6":15752,
            "36":0
        },
        "5":{
            "5":32,
            "6":15752,
            "36":0
        },
        "6":{
            "5":42,
            "6":35303,
            "36":0
        },
        "7":{
            "5":42,
            "6":35303,
            "36":0
        },
        "8":{
            "5":52,
            "6":17334,
            "36":0
        },
        "9":{
            "5":52,
            "6":17334,
            "36":0
        },
        "10":{
            "5":65,
            "6":23206,
            "36":0
        },
        "11":{
            "5":65,
            "6":23206,
            "36":0
    }
    },
    "locations":{
        "0":{
            "latitude":50.638437762,
            "longitude":3.125975041,
            "elevation":0
        },
        "5":{
            "latitude":50.63821090457489,
            "longitude":3.125491838207934,
            "elevation":0
        },
        "11":{
            "latitude":50.63806783149301,
            "longitude":3.125056386784151,
            "elevation":0
        }
    }
}

Curl

curl -X POST \
    https://api-eu.decathlon.net/sportstrackingdata/v2/activities \
  -H 'Authorization: Bearer {your bearer}' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {your api key}' \
  -d '{ {
    "name":"My workout",
    "startdate":"2018-04-19T08:28:49+02:00",
    "duration":954,
    "user":"/v2/users/{{user_id}}" ... }' 

Response

status 201 : Created
{
    "@context": "/v2/contexts/Activity",
    "@id": "/v2/activities/eu2a8ff4b670340f5144",
    "@type": "Activity",
    "id": "eu2a8ff4b670340f5144",
    "name": "My workout",
    "user": "/v2/users/ed3a20dfabaf09ae73f6",
    "sport": "/v2/sports/381",
    "userDevice": null,
    "startdate": "2018-04-19T08:28:49+02:00",
    "duration": 954,
    "latitude": null,
    "longitude": null,
    "elevation": null,
    "manual": false,
    "comment": null,
    "connector": "/v2/connectors/702",
    "userSession": null,
    "correctedElevation": false,
    "images": [],
    "thumbnail": "https://linkdata-ressources.geonaute.com/sports/381_h.jpg",
    "dataSummaries": {
        "5": 5095,
        "6": 86927,
        "9": 19227,
        "23": 148,
        "24": 954,
        "99": 88
    },
    "tags": [],
    "trackFlag": true,
    "datastreamFlag": true,
    "globalChallenge": null,
    "availableDatatypes": [
        6,
        9,
        5,
        24,
        23,
        99,
        36
    ],
    "createdAt": "2018-06-25T08:28:18+00:00",
    "updatedAt": "2018-06-25T08:28:18+00:00"
}

status 4xx : Client errors, check response for details.

status 5xx : Server errors, check response for details.

Some abstraction with referentials

These abstractions allow to manipulate any sports with any data. (Tennis, running, swimming, golf, etc.)

Limitations

Anatomy of an activity

In this part we describe the components of an activity.

Request

GET https://api-eu.decathlon.net/sportstrackingdata/v2/activities/{{ACTIVITY_TOKEN}}

Curl

curl -X GET \
    https://api-eu.decathlon.net/sportstrackingdata/v2/activities/{{ACTIVITY_TOKEN}} \
  -H 'Authorization: Bearer {your bearer}' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {your api key}'

Response

status 200 : OK
{
    "@context": "/v2/contexts/Activity",
    "@id": "/v2/activities/eu2cbe4bbb24082fd9ad",
    "@type": "Activity",
    "id": "eu2cbe4bbb24082fd9ad",
    "name": "Biking 2019-02-12 14:07",
    "user": "/v2/users/820d0XXXXXa7013969",
    "sport": "/v2/sports/381",
    "userDevice": null,
    "startdate": "2019-02-12T14:07:33+00:00",
    "duration": 8311,
    "latitude": 50.741407871246,
    "longitude": 3.2376379240304,
    "elevation": 35,
    "manual": true,
    "comment": null,
    "connector": null,
    "userSession": null,
    "correctedElevation": true,
    "images": [],
    "thumbnail": "https://linkdata-ressources-eu2.geonaute.com/prod/820d0XXXXXa7013969/maps/eu2cbe4bbb24082fd9ad.png",
    "dataSummaries": {
        "3": 159,
        "4": 122,
        "5": 18375,
        "7": 31554,
        "9": 12798,
        "11": 53,
        "13": 81,
        "15": 65,
        "16": 15,
        "18": 114,
        "19": 119,
        "23": 680,
        "24": 8311,
        "97": 435,
        "99": 435
    },
    "trackFlag": true,
    "datastreamFlag": true,
    "globalChallenge": null,
    "availableDatatypes": [
        3,
        4,
        5,
        7,
        9,
        11,
        13,
        23,
        24,
        97,
        99,
        18,
        19,
        16,
        15,
        20,
        1,
        10,
        6,
        14
    ],
    "createdAt": "2019-02-28T14:01:37+00:00",
    "updatedAt": "2019-02-28T14:01:40+00:00",
    "datastream": {
        "18": {
            "1": 117,
            "5": 0,
            "6": 4705,
            "10": 0,
            "14": 35,
            "20": 1
        },
        "19": {
            "1": 117,
            "5": 1.90784933,
            "6": 5684,
            "10": 0,
            "14": 35
        },
        "21": {
            "1": 117,
            "5": 6.143301449999999,
            "6": 7416,
            "10": 0,
            "14": 34.600586
        },

        // .... //

        "8308": {
            "1": 129,
            "5": 18375.077684660002,
            "6": 6152,
            "10": 0,
            "14": 30.799805
        },
        "8311": {
            "1": 130,
            "5": 18375.148398160003,
            "6": 0,
            "10": 0,
            "14": 30.799805
        }
    },
    "locations": {
        "18": {
            "latitude": 50.74140787124634,
            "longitude": 3.237637924030423,
            "elevation": 35
        },
        "19": {
            "latitude": 50.74142279103398,
            "longitude": 3.237651251256466,
            "elevation": 35
        },
        "21": {
            "latitude": 50.74145246297121,
            "longitude": 3.237688886001706,
            "elevation": 34.600586
        },

        // .... //

        "8308": {
            "latitude": 50.74317938648164,
            "longitude": 3.2363532297313213,
            "elevation": 30.799805
        },
        "8311": {
            "latitude": 50.7431798055768,
            "longitude": 3.2363539841026068,
            "elevation": 30.799805
        }
    },
    "tags": []
}

status 4xx : Client errors, check response for details.

status 5xx : Server errors, check response for details.

Zoom on descriptive fields

We find here all the field to basically describe the activity.

{
    "@context": "/v2/contexts/Activity",
    "@id": "/v2/activities/eu2cbe4bbb24082fd9ad",
    "@type": "Activity",
    "id": "eu2cbe4bbb24082fd9ad",
    "name": "Biking 2019-02-12 14:07",
    "user": "/v2/users/820d0XXXXXa7013969",
    "sport": "/v2/sports/381",// sport of the activity
    "userDevice": null, // Decathlon user device id, required if the activity is not manual
    "startdate": "2019-02-12T14:07:33+00:00", // datetime of the start of the activity
    "duration": 8311, // total duration in seconds
    "latitude": 50.741407871246, //first GPS points if exists
    "longitude": 3.2376379240304,
    "elevation": 35,
    "manual": true, // the activity is considered as manual when there is no Decathlon device declared
    "comment": null, // user comment on his activity
    "connector": null, // Decathlon Connector id, required if the activity is not manual
    "userSession": null, // Id of an userSession when the activity is linked to coaching content
    "correctedElevation": true, // internal flag when the elevation is corrected by satelite data
    "images": [], //collection of url images added to the activity
    "thumbnail": "https://linkdata-ressources-eu2.geonaute.com/prod/820d0XXXXXa7013969/maps/eu2cbe4bbb24082fd9ad.png", // thumbnail generated
    "trackFlag": true, // is the activity has a GPS track
    "datastreamFlag": true, // is the activity has a dataStream
    "globalChallenge": null, // if linked to a Decathlon global challenge
    "createdAt": "2019-02-28T14:01:37+00:00",
    "updatedAt": "2019-02-28T14:01:40+00:00",
    "tags": [] // collection of user tag attached to the activity

Zoom on dataSummaries

The dataSummaries are the data consolidated for the activity. You can store here for the whole activity different type of datatype :

{
    "dataSummaries": {
        "3": 159,
        "4": 122,
        "5": 18375, // total distance 18375 meters
        "7": 31554,
        "9": 12798, // average speed of 12.798 km/h
        "11": 53,
        "13": 81,
        "15": 65,
        "16": 15,
        "18": 114,
        "19": 119,
        "23": 680, // total kcal 680
        "24": 8311,
        "97": 435,
        "99": 435
    }
}

Zoom on availableDatatypes

This node declares all the datatypes used in the dataSummary or in the datastream.

{
    "availableDatatypes": [
        3,
        4,
        5,
        7,
        9,
        11,
        13,
        23,
        24,
        97,
        99,
        18,
        19,
        16,
        15,
        20,
        1,
        10,
        6,
        14
    ]
}

Zoom on datastream

The datastream is a vector depending to the elapsed_time (t0 = 0sec) with all the values which can be displayed as curves or timestamped event during the activity.

In the datastream we support all the datatypes supported (please refer to /v2/datatypes).

{
    "datastream": {
        "18": { //first measure at 18 seconds
            "1": 117, // current heart rate
            "5": 0, // 0 meters achieved
            "6": 4705, // 4,705 Km/h of current speed
            "10": 0,
            "14": 35,
            "20": 1 // a lap is declared here (as a boolean)
        },
        "19": {
            "1": 117,
            "5": 1.90784933,
            "6": 5684,
            "10": 0,
            "14": 35
        },
        "21": {
            "1": 117,
            "5": 6.143301449999999,
            "6": 7416,
            "10": 0,
            "14": 34.600586
        },

        // .... //

        "8308": {
            "1": 129,
            "5": 18375.077684660002,
            "6": 6152,
            "10": 0,
            "14": 30.799805
        },
        "8311": {
            "1": 130,
            "5": 18375.148398160003,
            "6": 0,
            "10": 0,
            "14": 30.799805
        }
    }
}

Zoom on locations

The locations stream is a vector depending to the elapsed_time (t0 = 0sec) with all the GPS coordinates to display the track of the user.

If the activity is stationary the node should be empty ("locations": {})

{
    "locations": {
        "18": {// first GPS point at 18 sec
            "latitude": 50.74140787124634,
            "longitude": 3.237637924030423,
            "elevation": 35
        },
        "19": {
            "latitude": 50.74142279103398,
            "longitude": 3.237651251256466,
            "elevation": 35
        },
        "21": {
            "latitude": 50.74145246297121,
            "longitude": 3.237688886001706,
            "elevation": 34.600586
        },

        // .... //

        "8308": {
            "latitude": 50.74317938648164,
            "longitude": 3.2363532297313213,
            "elevation": 30.799805
        },
        "8311": {
            "latitude": 50.7431798055768,
            "longitude": 3.2363539841026068,
            "elevation": 30.799805
        }
    }
}

GPX and TCX compatibility

You can also get an activity in GPX or TCX format.

Curl

curl -X GET \
    https://api-eu.decathlon.net/sportstrackingdata/v2/activities/{{ACTIVITY_TOKEN}} \
  -H 'Authorization: Bearer {your bearer}' \
  -H 'Accept: application/gpx+xml' \
  -H 'x-api-key: {your api key}'

Curl

curl -X GET \
    https://api-eu.decathlon.net/sportstrackingdata/v2/activities/{{ACTIVITY_TOKEN}} \
  -H 'Authorization: Bearer {your bearer}' \
  -H 'Accept: application/tcx+xml' \
  -H 'x-api-key: {your api key}'

Header accept for GPX

Accept: application/gpx+xml

Header accept for TPX

Accept: application/tcx+xml

User Records

All

These records concern the best activities on global value (datasummary)

Inside activity

These records are calculated inside the activity. You could do a slow 10 km but with the best 200m of your life. We grab it and store it here. All these records are with datatype duration (24) in seconds (aka the time to complete the distance).

Retreive user's records

Get the collection of records.

Request

GET https://api-eu.decathlon.net/sportstrackingdata/v2/user_records

Here we get all records for an user and specify the sport 121 (aka Running cf /v2/sports)

Curl

curl -X GET \
    https://api-eu.decathlon.net/sportstrackingdata/v2/user_records?sport=121 \
  -H 'Authorization: Bearer {your bearer}' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {your api key}' \

Response

status 200 : Ok
{
    "@context": "/v2/contexts/UserRecord",
    "@id": "/v2/user_records",
    "@type": "hydra:Collection",
    "hydra:member": [
        {
            "@id": "/v2/user_records/1558821",
            "@type": "UserRecord",
            "id": "1558821",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/5",
            "activity": "/v2/activities/eu21ec7ac76128fa6151",
            "sport": "/v2/sports/121",
            "type": "all",
            "value": 7651,
            "createdAt": "2019-01-30T20:19:53+00:00",
            "updatedAt": "2019-01-30T20:19:53+00:00",
            "date": "2018-11-18T12:00:00+00:00"
        },
        {
            "@id": "/v2/user_records/1558827",
            "@type": "UserRecord",
            "id": "1558827",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/99",
            "activity": "/v2/activities/eu21ec7ac76128fa6151",
            "sport": "/v2/sports/121",
            "type": "all",
            "value": 353,
            "createdAt": "2019-01-30T20:19:53+00:00",
            "updatedAt": "2019-01-30T20:19:53+00:00",
            "date": "2018-11-18T12:00:00+00:00"
        },
        {
            "@id": "/v2/user_records/1558826",
            "@type": "UserRecord",
            "id": "1558826",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/24",
            "activity": "/v2/activities/eu21ec7ac76128fa6151",
            "sport": "/v2/sports/121",
            "type": "all",
            "value": 2561,
            "createdAt": "2019-01-30T20:19:53+00:00",
            "updatedAt": "2019-01-30T20:19:53+00:00",
            "date": "2018-11-18T12:00:00+00:00"
        },
        {
            "@id": "/v2/user_records/1558825",
            "@type": "UserRecord",
            "id": "1558825",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/23",
            "activity": "/v2/activities/eu21ec7ac76128fa6151",
            "sport": "/v2/sports/121",
            "type": "all",
            "value": 538,
            "createdAt": "2019-01-30T20:19:53+00:00",
            "updatedAt": "2019-01-30T20:19:53+00:00",
            "date": "2018-11-18T12:00:00+00:00"
        },
        {
            "@id": "/v2/user_records/1558824",
            "@type": "UserRecord",
            "id": "1558824",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/19",
            "activity": "/v2/activities/eu21ec7ac76128fa6151",
            "sport": "/v2/sports/121",
            "type": "all",
            "value": 39,
            "createdAt": "2019-01-30T20:19:53+00:00",
            "updatedAt": "2019-01-30T20:19:53+00:00",
            "date": "2018-11-18T12:00:00+00:00"
        },
        {
            "@id": "/v2/user_records/1558823",
            "@type": "UserRecord",
            "id": "1558823",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/18",
            "activity": "/v2/activities/eu21ec7ac76128fa6151",
            "sport": "/v2/sports/121",
            "type": "all",
            "value": 40,
            "createdAt": "2019-01-30T20:19:53+00:00",
            "updatedAt": "2019-01-30T20:19:53+00:00",
            "date": "2018-11-18T12:00:00+00:00"
        },
        {
            "@id": "/v2/user_records/1558822",
            "@type": "UserRecord",
            "id": "1558822",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/9",
            "activity": "/v2/activities/eu21ec7ac76128fa6151",
            "sport": "/v2/sports/121",
            "type": "all",
            "value": 10755,
            "createdAt": "2019-01-30T20:19:53+00:00",
            "updatedAt": "2019-01-30T20:19:53+00:00",
            "date": "2018-11-18T12:00:00+00:00"
        },
        {
            "@id": "/v2/user_records/1558816",
            "@type": "UserRecord",
            "id": "1558816",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/24",
            "activity": "/v2/activities/eu21ec7ac76128fa6151",
            "sport": "/v2/sports/121",
            "type": "distance.804m",
            "value": 246,
            "createdAt": "2019-01-30T20:19:52+00:00",
            "updatedAt": "2019-01-30T20:19:53+00:00",
            "date": "2018-11-18T12:00:00+00:00"
        },
        {
            "@id": "/v2/user_records/1558820",
            "@type": "UserRecord",
            "id": "1558820",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/24",
            "activity": "/v2/activities/eu21ec7ac76128fa6151",
            "sport": "/v2/sports/121",
            "type": "distance.5000m",
            "value": 1654,
            "createdAt": "2019-01-30T20:19:52+00:00",
            "updatedAt": "2019-01-30T20:19:52+00:00",
            "date": "2018-11-18T12:00:00+00:00"
        },
        {
            "@id": "/v2/user_records/1558815",
            "@type": "UserRecord",
            "id": "1558815",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/24",
            "activity": "/v2/activities/eu21ec7ac76128fa6151",
            "sport": "/v2/sports/121",
            "type": "distance.400m",
            "value": 116,
            "createdAt": "2019-01-30T20:19:52+00:00",
            "updatedAt": "2019-01-30T20:19:52+00:00",
            "date": "2018-11-18T12:00:00+00:00"
        },
        {
            "@id": "/v2/user_records/1558817",
            "@type": "UserRecord",
            "id": "1558817",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/24",
            "activity": "/v2/activities/eu21ec7ac76128fa6151",
            "sport": "/v2/sports/121",
            "type": "distance.1000m",
            "value": 312,
            "createdAt": "2019-01-30T20:19:52+00:00",
            "updatedAt": "2019-01-30T20:19:52+00:00",
            "date": "2018-11-18T12:00:00+00:00"
        },
        {
            "@id": "/v2/user_records/1558818",
            "@type": "UserRecord",
            "id": "1558818",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/24",
            "activity": "/v2/activities/eu21ec7ac76128fa6151",
            "sport": "/v2/sports/121",
            "type": "distance.1609m",
            "value": 515,
            "createdAt": "2019-01-30T20:19:52+00:00",
            "updatedAt": "2019-01-30T20:19:52+00:00",
            "date": "2018-11-18T12:00:00+00:00"
        },
        {
            "@id": "/v2/user_records/1558814",
            "@type": "UserRecord",
            "id": "1558814",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/24",
            "activity": "/v2/activities/eu21ec7ac76128fa6151",
            "sport": "/v2/sports/121",
            "type": "distance.200m",
            "value": 57,
            "createdAt": "2019-01-30T20:19:52+00:00",
            "updatedAt": "2019-01-30T20:19:52+00:00",
            "date": "2018-11-18T12:00:00+00:00"
        },
        {
            "@id": "/v2/user_records/1558819",
            "@type": "UserRecord",
            "id": "1558819",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/24",
            "activity": "/v2/activities/eu21ec7ac76128fa6151",
            "sport": "/v2/sports/121",
            "type": "distance.3218m",
            "value": 1044,
            "createdAt": "2019-01-30T20:19:52+00:00",
            "updatedAt": "2019-01-30T20:19:53+00:00",
            "date": "2018-11-18T12:00:00+00:00"
        },
        {
            "@id": "/v2/user_records/1558802",
            "@type": "UserRecord",
            "id": "1558802",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/5",
            "activity": "/v2/activities/eu2511d65eadf35f5083",
            "sport": "/v2/sports/121",
            "type": "all",
            "value": 934,
            "createdAt": "2019-01-30T20:18:54+00:00",
            "updatedAt": "2019-01-30T20:18:54+00:00",
            "date": "2019-01-30T12:00:00+00:00"
        },
        {
            "@id": "/v2/user_records/1558808",
            "@type": "UserRecord",
            "id": "1558808",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/99",
            "activity": "/v2/activities/eu2511d65eadf35f5083",
            "sport": "/v2/sports/121",
            "type": "all",
            "value": 24,
            "createdAt": "2019-01-30T20:18:54+00:00",
            "updatedAt": "2019-01-30T20:18:54+00:00",
            "date": "2019-01-30T12:00:00+00:00"
        },
        {
            "@id": "/v2/user_records/1558803",
            "@type": "UserRecord",
            "id": "1558803",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/9",
            "activity": "/v2/activities/eu2511d65eadf35f5083",
            "sport": "/v2/sports/121",
            "type": "all",
            "value": 5797,
            "createdAt": "2019-01-30T20:18:54+00:00",
            "updatedAt": "2019-01-30T20:18:54+00:00",
            "date": "2019-01-30T12:00:00+00:00"
        },
        {
            "@id": "/v2/user_records/1558807",
            "@type": "UserRecord",
            "id": "1558807",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/24",
            "activity": "/v2/activities/eu2511d65eadf35f5083",
            "sport": "/v2/sports/121",
            "type": "all",
            "value": 580,
            "createdAt": "2019-01-30T20:18:54+00:00",
            "updatedAt": "2019-01-30T20:18:54+00:00",
            "date": "2019-01-30T12:00:00+00:00"
        },
        {
            "@id": "/v2/user_records/1558806",
            "@type": "UserRecord",
            "id": "1558806",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/23",
            "activity": "/v2/activities/eu2511d65eadf35f5083",
            "sport": "/v2/sports/121",
            "type": "all",
            "value": 37,
            "createdAt": "2019-01-30T20:18:54+00:00",
            "updatedAt": "2019-01-30T20:18:54+00:00",
            "date": "2019-01-30T12:00:00+00:00"
        },
        {
            "@id": "/v2/user_records/1558804",
            "@type": "UserRecord",
            "id": "1558804",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/18",
            "activity": "/v2/activities/eu2511d65eadf35f5083",
            "sport": "/v2/sports/121",
            "type": "all",
            "value": 9,
            "createdAt": "2019-01-30T20:18:54+00:00",
            "updatedAt": "2019-01-30T20:18:54+00:00",
            "date": "2019-01-30T12:00:00+00:00"
        },
        {
            "@id": "/v2/user_records/1558805",
            "@type": "UserRecord",
            "id": "1558805",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/19",
            "activity": "/v2/activities/eu2511d65eadf35f5083",
            "sport": "/v2/sports/121",
            "type": "all",
            "value": 10,
            "createdAt": "2019-01-30T20:18:54+00:00",
            "updatedAt": "2019-01-30T20:18:54+00:00",
            "date": "2019-01-30T12:00:00+00:00"
        },
        {
            "@id": "/v2/user_records/1558799",
            "@type": "UserRecord",
            "id": "1558799",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/24",
            "activity": "/v2/activities/eu2511d65eadf35f5083",
            "sport": "/v2/sports/121",
            "type": "distance.200m",
            "value": 112,
            "createdAt": "2019-01-30T20:18:53+00:00",
            "updatedAt": "2019-01-30T20:18:53+00:00",
            "date": "2019-01-30T12:00:00+00:00"
        },
        {
            "@id": "/v2/user_records/1558800",
            "@type": "UserRecord",
            "id": "1558800",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/24",
            "activity": "/v2/activities/eu2511d65eadf35f5083",
            "sport": "/v2/sports/121",
            "type": "distance.400m",
            "value": 236,
            "createdAt": "2019-01-30T20:18:53+00:00",
            "updatedAt": "2019-01-30T20:18:53+00:00",
            "date": "2019-01-30T12:00:00+00:00"
        },
        {
            "@id": "/v2/user_records/1558801",
            "@type": "UserRecord",
            "id": "1558801",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/24",
            "activity": "/v2/activities/eu2511d65eadf35f5083",
            "sport": "/v2/sports/121",
            "type": "distance.804m",
            "value": 491,
            "createdAt": "2019-01-30T20:18:53+00:00",
            "updatedAt": "2019-01-30T20:18:53+00:00",
            "date": "2019-01-30T12:00:00+00:00"
        }
    ],
    "hydra:view": {
        "@id": "/v2/user_records?sport=121&page=1",
        "@type": "hydra:PartialCollectionView"
    },
    "hydra:search": {
        "@type": "hydra:IriTemplate",
        "hydra:template": "/v2/user_records{?activity,activity[],sport,sport[],type,type[],order[id],order[type],order[value],order[createdAt],order[updatedAt]}",
        "hydra:variableRepresentation": "BasicRepresentation",
        "hydra:mapping": [
            {
                "@type": "IriTemplateMapping",
                "variable": "activity",
                "property": "activity",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "activity[]",
                "property": "activity",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "sport",
                "property": "sport",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "sport[]",
                "property": "sport",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "type",
                "property": "type",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "type[]",
                "property": "type",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "order[id]",
                "property": "id",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "order[type]",
                "property": "type",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "order[value]",
                "property": "value",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "order[createdAt]",
                "property": "createdAt",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "order[updatedAt]",
                "property": "updatedAt",
                "required": false
            }
        ]
    }
}

status 4xx : Client errors, check response for details.

status 5xx : Server errors, check response for details.


Focus on record element

{
            "@id": "/v2/user_records/1558822",
            "@type": "UserRecord",
            "id": "1558822",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/9",
            "activity": "/v2/activities/eu21ec7ac76128fa6151",
            "sport": "/v2/sports/121",
            "type": "all",
            "value": 10755,
            "createdAt": "2019-01-30T20:19:53+00:00",
            "updatedAt": "2019-01-30T20:19:53+00:00",
            "date": "2018-11-18T12:00:00+00:00"
        }

We can distinguish, five major fields :

A record type all

A record type distance.x

A record type distance.5000m

        {
            "@id": "/v2/user_records/1558820",
            "@type": "UserRecord",
            "id": "1558820",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/24",
            "activity": "/v2/activities/eu21ec7ac76128fa6151",
            "sport": "/v2/sports/121",
            "type": "distance.5000m",
            "value": 1654,
            "createdAt": "2019-01-30T20:19:52+00:00",
            "updatedAt": "2019-01-30T20:19:52+00:00",
            "date": "2018-11-18T12:00:00+00:00"
        }

Calculation of records

The records are calculated automatically after the import of an activity. To delete a record, you have to modify or delete the activity attached to the record.

Share an activity

It is possible to activate public sharing of an activity. Everyone will be able to access to the activity by API without any user security.

When you share an activity, you create a public token that you can repudiate.

Create the public share token

Firstly, you need the URI of the activity that you want to share, example :

Request

GET https://api-eu.decathlon.net/sportstrackingdata/v2/share_activities

Request Body

{
  "user": "/v2/users/eu23d736c047075def68",
  "activity": "/v2/activities/eu2511d65eadf35f5083"
}

Curl

curl -X POST \
    https://api-eu.decathlon.net/sportstrackingdata/v2/share_activities \
  -H 'Authorization: Bearer {your bearer}' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {your api key}' \
  -d '{
  "user": "/v2/users/eu23d736c047075def68",
  "activity": "/v2/activities/eu2511d65eadf35f5083"
}' 

Response

status 201 : Created
{
    "@context": "/v2/contexts/ShareActivity",
    "@id": "/v2/share_activities/eu244e2e987f749dbde5",
    "@type": "ShareActivity",
    "id": "eu244e2e987f749dbde5",
    "user": "/v2/users/eu23d736c047075def68",
    "activity": {
        "@id": "/v2/activities/eu2511d65eadf35f5083",
        "@type": "Activity",
        "id": "eu2511d65eadf35f5083",
        "name": "Test V2 - Android - 30 janvier 2019",
        "user": "/v2/users/eu23d736c047075def68",
        "sport": "/v2/sports/121",
        "userDevice": null,
        "startdate": "2019-01-30T12:00:00+00:00",
        "duration": 580,
        "latitude": 50.6445,
        "longitude": 3.14039,
        "elevation": 28,
        "manual": true,
        "comment": null,
        "connector": null,
        "userSession": null,
        "images": [],
        "thumbnail": "https://linkdata-ressources-eu2.geonaute.com/preprod/eu23d736c047075def68/maps/eu2511d65eadf35f5083.png",
        "dataSummaries": {
            "5": 934,
            "7": 9000,
            "9": 5797,
            "15": 37,
            "16": 27,
            "18": 9,
            "19": 10,
            "23": 37,
            "24": 580,
            "97": 24,
            "99": 24
        },
        "globalChallenge": null,
        "availableDatatypes": [
            5,
            7,
            9,
            15,
            16,
            18,
            19,
            23,
            24,
            97,
            99,
            14,
            6
        ],
        "createdAt": "2019-01-30T20:18:51+00:00",
        "updatedAt": "2019-01-30T20:18:54+00:00",
        "datastream": {
            "0": {
                "5": 0,
                "6": 4680,
                "14": 28.40039
            },
            "4": {
                "5": 5,
                "6": 4400,
                "14": 28.299805
            },
            "5": {
                "5": 6,
                "6": 4320,
                "14": 28.299805
            },
            "9": {
                "5": 11,
                "6": 5400,
                "14": 28.299805
            },
            "10": {
                "5": 13,
                "6": 5400,
                "14": 28.299805
            },
            ...
        },
        "locations": {
            "0": {
                "latitude": 50.6445,
                "longitude": 3.14039,
                "elevation": 28.40039
            },
            "4": {
                "latitude": 50.64447,
                "longitude": 3.14033,
                "elevation": 28.299805
            },
            "5": {
                "latitude": 50.64446,
                "longitude": 3.14032,
                "elevation": 28.299805
            },
            ...
        },
        "tags": null
    }
}

status 4xx : Client errors, check response for details.

status 5xx : Server errors, check response for details.


Thank to the new share URI : "/v2/share_activities/eu244e2e987f749dbde5" you will be able to get this activity.

GET the activity

Curl

curl -X GET \
  https://api-eu.decathlon.net/sportstrackingdata/v2/share_activities/eu244e2e987f749dbde5 \
  -H 'Accept: application/ld+json, application/json, text/html' 
  -H 'x-api-key: {your api key}' \

Once the share public token generated, you can GET the activity without any user security.

GET "/v2/share_activities/eu244e2e987f749dbde5"

Photos and Thumbnails

By default, for each sport activity the API generates a thumbnail (a map or a picture of the sport practiced). You could change this thumbnail url and add many url photos to your activity. To facilitate the use of url, we provide an API to store pictures online.

Content Level Limitation
Thumbnail Recommandation less than 300Ko
Photo Mandatory less than 3Mo

Upload a photo

Request

POST https://api-eu.decathlon.net/sportstrackingdata/v2/upload

Curl

curl -X POST \
    https://api-eu.decathlon.net/sportstrackingdata/v2/upload \
  -H 'Authorization: Bearer {your bearer}' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {your api key}' \
  -F 'file=@/path/myphoto.jpg' 

Response

status 200 : Ok
{
"url":"https:\/\/example.com/2caf4b77b497b64bef1c3ba2b1d0744f25db3ce3"
}

status 4xx : Client errors, check response for details.

status 5xx : Server errors, check response for details.


Add photo to an activity

Request

PUT https://api-eu.decathlon.net/sportstrackingdata/v2/activities/TOKEN

Curl

curl -X PUT \
    https://api-eu.decathlon.net/sportstrackingdata/v2/activities/TOKEN \
  -H 'Authorization: Bearer {your bearer}' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {your api key}' \
  -d '{
"images":["https://example.com/2caf4b77b497b64bef1c3ba2b1d0744f25db3ce3"]
}'

Change the thumbnail

Curl

curl -X PUT \
    https://api-eu.decathlon.net/sportstrackingdata/v2/activities/TOKEN \
  -H 'Authorization: Bearer {your bearer}' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {your api key}' \
  -d '{
"thumbnail":"https://example.com/2caf4b77b497b64bef1c3ba2b1d0744f25db3ce3"
}'

Before changing the thumbnail, it could be useful to save the actual thumbnail as an image to not lose the url generated by the API.

Request

PUT https://api-eu.decathlon.net/sportstrackingdata/v2/activities/TOKEN

User measures

User measures allows you to do quantified self for your body on many datatypes (weight, Body fat, height, Heart rate min, max, ...). Each measure is dated, when you get a collection you can show the evolution of the datatype selected.

Reminder about Datatypes

For these examples we will use the datatype 181: Weight in gramms :

GET https://api-eu.decathlon.net/sportstrackingdata/v2/datatypes/181

{
    "@context": "/v2/contexts/Datatype",
    "@id": "/v2/datatypes/181",
    "@type": "Datatype",
    "id": 181,
    "unit": "g",
    "translatedNames": {
        "en": "Weight"
    },
    "translatedDescriptions": {
        "en": null
    },
    "recordWay": 0,
    "cumulable": false,
    "active": true,
    "createdAt": "2018-03-14T21:36:31+00:00",
    "updatedAt": "2018-03-23T10:23:55+00:00"
}

Create a new user measure

Request

POST https://api-eu.decathlon.net/sportstrackingdata/v2/user_measures

Request Body

{
  "user": "/v2/users/eu23d736c047075def68",
  "datatype": "/v2/datatypes/181",
  "value": 70000,
  "date": "2018-04-18T19:36:41.081Z"
}

You will need to indicated some URI ressources to create a new user measure :

Curl

curl -X POST \
    https://api-eu.decathlon.net/sportstrackingdata/v2/user_measures \
  -H 'Authorization: Bearer {your bearer}' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {your api key}' \
  -d '{
  "user": "/v2/users/eu23d736c047075def68",
  "datatype": "/v2/datatypes/181",
  "value": 70000,
  "date": "2018-04-18T19:36:41.081Z"
}' 

Response

status 201 : Created
{
    "@context": "/v2/contexts/UserMeasure",
    "@id": "/v2/user_measures/738526",
    "@type": "UserMeasure",
    "id": "738526",
    "user": "/v2/users/eu23d736c047075def68",
    "datatype": "/v2/datatypes/181",
    "value": 70000,
    "date": "2018-04-18T19:36:41+00:00",
    "createdAt": "2019-01-30T21:12:15+00:00",
    "updatedAt": "2019-01-30T21:12:15+00:00"
}

status 4xx : Client errors, check response for details.

status 5xx : Server errors, check response for details.

Get user measures

Curl

curl -X GET \
    https://api-eu.decathlon.net/sportstrackingdata/v2/user_measures?datatype=181 \
  -H 'Authorization: Bearer {your bearer}' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {your api key}' 

Response

status 200 : Ok
{
    "@context": "/v2/contexts/UserMeasure",
    "@id": "/v2/user_measures",
    "@type": "hydra:Collection",
    "hydra:member": [
        {
            "@id": "/v2/user_measures/738525",
            "@type": "UserMeasure",
            "id": "738525",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/181",
            "value": 90000,
            "date": "2019-01-30T20:16:36+00:00",
            "createdAt": "2019-01-30T20:16:36+00:00",
            "updatedAt": "2019-01-30T20:16:36+00:00"
        },
        {
            "@id": "/v2/user_measures/738526",
            "@type": "UserMeasure",
            "id": "738526",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/181",
            "value": 70000,
            "date": "2018-04-18T19:36:41+00:00",
            "createdAt": "2019-01-30T21:12:15+00:00",
            "updatedAt": "2019-01-30T21:12:15+00:00"
        },
        {
            "@id": "/v2/user_measures/738528",
            "@type": "UserMeasure",
            "id": "738528",
            "user": "/v2/users/eu23d736c047075def68",
            "datatype": "/v2/datatypes/181",
            "value": 69042,
            "date": "2019-01-18T19:36:41+00:00",
            "createdAt": "2019-01-30T21:14:18+00:00",
            "updatedAt": "2019-01-30T21:14:18+00:00"
        }
    ],
    "hydra:view": {
        "@id": "/v2/user_measures?datatype=181&page=1",
        "@type": "hydra:PartialCollectionView"
    },
    "hydra:search": {
        "@type": "hydra:IriTemplate",
        "hydra:template": "/v2/user_measures{?user,user[],date,date[],datatype,datatype[],order[id],order[value],order[date],order[dateTimezone],order[createdAt],order[updatedAt],date[before],date[strictly_before],date[after],date[strictly_after]}",
        "hydra:variableRepresentation": "BasicRepresentation",
        "hydra:mapping": [
            {
                "@type": "IriTemplateMapping",
                "variable": "user",
                "property": "user",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "user[]",
                "property": "user",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "date",
                "property": "date",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "date[]",
                "property": "date",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "datatype",
                "property": "datatype",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "datatype[]",
                "property": "datatype",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "order[id]",
                "property": "id",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "order[value]",
                "property": "value",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "order[date]",
                "property": "date",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "order[dateTimezone]",
                "property": "dateTimezone",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "order[createdAt]",
                "property": "createdAt",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "order[updatedAt]",
                "property": "updatedAt",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "date[before]",
                "property": "date",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "date[strictly_before]",
                "property": "date",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "date[after]",
                "property": "date",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "date[strictly_after]",
                "property": "date",
                "required": false
            }
        ]
    }
}
status 4xx : Client errors, check response for details.

status 5xx : Server errors, check response for details.


User statistics

The user_sumups can give you consolidated statistics on period (years and months). The user_sumups element :

Parameters

The API accepts many parameters to reach quickly the data you want.

period
period[]
user,user[]
type,type[]
order[id]
order[type]
order[period]
order[value]
order[createdAt]
order[updatedAt]
period[between]
period[gt]
period[gte]
period[lt]
period[lte]

Retreive user's sumups

In this example we will look for statistics on 2018 for the running sport (121)

Request

GET https://api-eu.decathlon.net/sportstrackingdata/v2/user_sumups

Curl

curl -X GET \
    https://api-eu.decathlon.net/sportstrackingdata/v2/user_sumups?period=2018&sport=121 \
  -H 'Authorization: Bearer {your bearer}' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {your api key}' \

Response

status 200 : Ok
{
    "@context": "/v2/contexts/UserSumup",
    "@id": "/v2/user_sumups",
    "@type": "hydra:Collection",
    "hydra:member": [
        {
            "@id": "/v2/user_sumups/5774260",
            "@type": "UserSumup",
            "id": "5774260",
            "type": "YearlySumup",
            "user": "/v2/users/eu23d736c047075def68",
            "sport": "/v2/sports/121",
            "datatype": "/v2/datatypes/5",
            "period": "2018",
            "value": 7651,
            "createdAt": "2019-01-30T20:19:54+00:00",
            "updatedAt": "2019-01-30T20:19:54+00:00"
        },
        {
            "@id": "/v2/user_sumups/5774261",
            "@type": "UserSumup",
            "id": "5774261",
            "type": "YearlySumup",
            "user": "/v2/users/eu23d736c047075def68",
            "sport": "/v2/sports/121",
            "datatype": "/v2/datatypes/18",
            "period": "2018",
            "value": 40,
            "createdAt": "2019-01-30T20:19:54+00:00",
            "updatedAt": "2019-01-30T20:19:54+00:00"
        },
        {
            "@id": "/v2/user_sumups/5774262",
            "@type": "UserSumup",
            "id": "5774262",
            "type": "YearlySumup",
            "user": "/v2/users/eu23d736c047075def68",
            "sport": "/v2/sports/121",
            "datatype": "/v2/datatypes/19",
            "period": "2018",
            "value": 39,
            "createdAt": "2019-01-30T20:19:54+00:00",
            "updatedAt": "2019-01-30T20:19:54+00:00"
        },
        {
            "@id": "/v2/user_sumups/5774263",
            "@type": "UserSumup",
            "id": "5774263",
            "type": "YearlySumup",
            "user": "/v2/users/eu23d736c047075def68",
            "sport": "/v2/sports/121",
            "datatype": "/v2/datatypes/23",
            "period": "2018",
            "value": 538,
            "createdAt": "2019-01-30T20:19:54+00:00",
            "updatedAt": "2019-01-30T20:19:54+00:00"
        },
        {
            "@id": "/v2/user_sumups/5774264",
            "@type": "UserSumup",
            "id": "5774264",
            "type": "YearlySumup",
            "user": "/v2/users/eu23d736c047075def68",
            "sport": "/v2/sports/121",
            "datatype": "/v2/datatypes/24",
            "period": "2018",
            "value": 2561,
            "createdAt": "2019-01-30T20:19:54+00:00",
            "updatedAt": "2019-01-30T20:19:54+00:00"
        },
        {
            "@id": "/v2/user_sumups/5774265",
            "@type": "UserSumup",
            "id": "5774265",
            "type": "YearlySumup",
            "user": "/v2/users/eu23d736c047075def68",
            "sport": "/v2/sports/121",
            "datatype": "/v2/datatypes/97",
            "period": "2018",
            "value": 353,
            "createdAt": "2019-01-30T20:19:54+00:00",
            "updatedAt": "2019-01-30T20:19:54+00:00"
        },
        {
            "@id": "/v2/user_sumups/5774266",
            "@type": "UserSumup",
            "id": "5774266",
            "type": "YearlySumup",
            "user": "/v2/users/eu23d736c047075def68",
            "sport": "/v2/sports/121",
            "datatype": "/v2/datatypes/99",
            "period": "2018",
            "value": 353,
            "createdAt": "2019-01-30T20:19:54+00:00",
            "updatedAt": "2019-01-30T20:19:54+00:00"
        },
        {
            "@id": "/v2/user_sumups/5774267",
            "@type": "UserSumup",
            "id": "5774267",
            "type": "YearlySumup",
            "user": "/v2/users/eu23d736c047075def68",
            "sport": "/v2/sports/121",
            "datatype": "/v2/datatypes/98",
            "period": "2018",
            "value": 1,
            "createdAt": "2019-01-30T20:19:54+00:00",
            "updatedAt": "2019-01-30T20:19:54+00:00"
        }
    ],
    "hydra:view": {
        "@id": "/v2/user_sumups?period=2018&sport=121&page=1",
        "@type": "hydra:PartialCollectionView"
    },
    "hydra:search": {
        "@type": "hydra:IriTemplate",
        "hydra:template": "/v2/user_sumups{?period,period[],user,user[],type,type[],order[id],order[type],order[period],order[value],order[createdAt],order[updatedAt],period[between],period[gt],period[gte],period[lt],period[lte]}",
        "hydra:variableRepresentation": "BasicRepresentation",
        "hydra:mapping": [
            {
                "@type": "IriTemplateMapping",
                "variable": "period",
                "property": "period",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "period[]",
                "property": "period",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "user",
                "property": "user",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "user[]",
                "property": "user",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "type",
                "property": "type",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "type[]",
                "property": "type",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "order[id]",
                "property": "id",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "order[type]",
                "property": "type",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "order[period]",
                "property": "period",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "order[value]",
                "property": "value",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "order[createdAt]",
                "property": "createdAt",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "order[updatedAt]",
                "property": "updatedAt",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "period[between]",
                "property": "period",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "period[gt]",
                "property": "period",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "period[gte]",
                "property": "period",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "period[lt]",
                "property": "period",
                "required": false
            },
            {
                "@type": "IriTemplateMapping",
                "variable": "period[lte]",
                "property": "period",
                "required": false
            }
        ]
    }
}

status 4xx : Client errors, check response for details.

status 5xx : Server errors, check response for details.

Explaining a sumup element

{
            "@id": "/v2/user_sumups/5774260",
            "@type": "UserSumup",
            "id": "5774260",
            "type": "YearlySumup", //type year
            "user": "/v2/users/eu23d736c047075def68",
            "sport": "/v2/sports/121", //sport running 121
            "datatype": "/v2/datatypes/5", // Distance in meter
            "period": "2018",
            "value": 7651, // value realised so 7,6Km of running in 2018
            "createdAt": "2019-01-30T20:19:54+00:00",
            "updatedAt": "2019-01-30T20:19:54+00:00"
        }

User Agreement

An easy solution to store the user agreement to use your service.

WARNING : once you have User Agreements on an account, if they are all rejected, the user account is deleted. If there is no anymore agreement accepted, we don't have the right to store the user data.

Create an user agreement

You store the acceptance of your user on your service and the filename of your legal contract.

Each user agreement has a state ( accepted | pending | rejected ).

Request

POST https://api-eu.decathlon.net/sportstrackingdata/v2/user_agreements

Curl

curl -X POST \
    https://api-eu.decathlon.net/sportstrackingdata/v2/user_agreements \
  -H 'Authorization: Bearer {your bearer}' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {your api key}' \
  -d '{
  "user": "/v2/users/#USER_ID#",
  "serviceKey": "DecathlonCoach",
  "state": "accepted",
  "filename": "legal-document-CGS-v1.1-20180808"
    }' 

Response

status 201 : Created
{
    "@context": "/v2/contexts/UserAgreement",
    "@id": "/v2/user_agreements/1",
    "@type": "UserAgreement",
    "id": 1,
    "user": "/v2/users/820d0XXXXXa7013969",
    "serviceKey": "DecathlonCoach",
    "state": "accepted",
    "dateAccept": "2018-08-10T13:28:10+00:00",
    "dateRepudiation": null,
    "filename": "legal-document-CGS-v1.1-20180808",
    "createdAt": "2018-08-10T13:28:10+00:00",
    "updatedAt": "2018-08-10T13:28:10+00:00"
}

status 4xx : Client errors, check response for details.

status 5xx : Server errors, check response for details.


Get the collection of User Agreement or a single ressource

You can list all the user agreements and access to specific one.

Request

GET https://api-eu.decathlon.net/sportstrackingdata/v2/user_agreements

GET https://api-eu.decathlon.net/sportstrackingdata/v2/user_agreements/#RESSOURCEID#

Curl

curl -X GET \
    https://api-eu.decathlon.net/sportstrackingdata/v2/user_agreements \
  -H 'Authorization: Bearer {your bearer}' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {your api key}' 

Response

status 200 : Ok
{
    "@context": "/v2/contexts/UserAgreement",
    "@id": "/v2/user_agreements",
    "@type": "hydra:Collection",
    "hydra:member": [
        {
            "@id": "/v2/user_agreements/1",
            "@type": "UserAgreement",
            "id": 1,
            "user": "/v2/users/820d0XXXXXa7013969",
            "serviceKey": "DecathlonCoach",
            "state": "accepted",
            "dateAccept": "2018-08-10T13:28:10+00:00",
            "dateRepudiation": null,
            "filename": "legal-document-CGS-v1.1-20180808",
            "createdAt": "2018-08-10T13:28:10+00:00",
            "updatedAt": "2018-08-10T13:28:10+00:00"
        }
    ]
}
status 4xx : Client errors, check response for details.

status 5xx : Server errors, check response for details.


Modify an user agreement

You can modify the state of an user agreement. For example if an user wants to revoke its acceptance to the service.

Request

PUT https://api-eu.decathlon.net/sportstrackingdata/v2/user_agreements/#RESSOURCEID#

Curl

curl -X PUT \
    https://api-eu.decathlon.net/sportstrackingdata/v2/user_agreements/#RESSOURCEID# \
  -H 'Authorization: Bearer {your bearer}' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {your api key}' \
  -d '{
  "state": "rejected"
    }' 

Response

status 200 : OK
{
    "@context": "/v2/contexts/UserAgreement",
    "@id": "/v2/user_agreements/1",
    "@type": "UserAgreement",
    "id": 1,
    "user": "/v2/users/820d0XXXXXa7013969",
    "serviceKey": "DecathlonCoach",
    "state": "rejected",
    "dateAccept": "2018-08-10T13:28:10+00:00",
    "dateRepudiation": null,
    "filename": "legal-document-CGS-v1.1-20180808",
    "createdAt": "2018-08-10T13:28:10+00:00",
    "updatedAt": "2018-08-10T13:28:10+00:00"
}

status 4xx : Client errors, check response for details.

status 5xx : Server errors, check response for details.


Other RGPD rights

The API permits to export all your data and receive a link to access to your archive.

The API permits to delete your account, a delay of 24 hours may be applicable.

Webhook

We support a webhook system on the event of an activity create ("activity_create"). For a user, if you create a webhook to an URL that you manage, you will receive POST request with the user id and activity id every time an activity is added for this user.

Create a webhook

Request

POST https://api-eu.decathlon.net/sportstrackingdata/v2/user_web_hooks

Curl

curl -X POST \
    https://api-eu.decathlon.net/sportstrackingdata/v2/user_web_hooks \
  -H 'Authorization: Bearer {your bearer}' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {your api key}' \
  -d '{
    "user": "/v2/users/#USER_ID#",
    "url": "https://XXXXXXX.com/webhook_callback",
    "events": [
        "activity_create"
    ]
    }' 

Response

status 201 : Created
{
    "@context": "/v2/contexts/UserWebHook",
    "@id": "/v2/user_web_hooks/euXf9507eXXXXX997707",
    "@type": "UserWebHook",
    "id": "euXf9507eXXXXX997707",
    "user": "/v2/users/#USER_ID#",
    "url": "https://XXXXXXX.com/webhook_callback",
    "events": [
        "activity_create"
    ],
    "createdAt": "2019-03-18T21:23:50+00:00",
    "updatedAt": "2019-03-18T21:23:50+00:00"
}

status 4xx : Client errors, check response for details.

status 5xx : Server errors, check response for details.


Format of the POST message

{
    "user_id":"ed3a20dfabaf09ae73f6",
    "event":{
        "name":"activity_create",
        "ressource_id":"eu2f21a9d01104a7bbe9",
        "event_time":1552944296
        }
}

The equivalent request made by Sports Tracking Data to your webhook url.

Curl

curl -X POST \
  https://XXXXXXX.com/webhook_callback \
  -d '{"user_id":"ed3a20dfabaf09ae73f6","event":{"name":"activity_create","ressource_id":"eu2f21a9d01104a7bbe9","event_time":1552944296}}'

Glossary

Roadmap

V1 retro-compatibility

The v1 is supported until 2020. The v1 doesn't receive the new features.

V2 new features

Support

contacts

Pre-requisites to support

Contact us with a curl showing :

And/Or :

Discussion

If you have any questions, feedbacks, feel free to share it on our Google groups : https://groups.google.com/forum/#!forum/sports-tracking-data-api-news

Language prefered : English.