Skip to content

Create live track

POST /v1/track

Send body as JSON.

Request

bash
curl -X POST -H "Content-Type: application/json" -H "X-STL-Token: {{token}}" -d '{
    "track": {
        "category_name": "paragliding",
        "track_type": "live_track"
    },
    "location": {
        "latitude": 42.458980,
        "longitude": 2.767730,
        "speed": 0,
        "bearing": 213,
        "altitude": 829,
        "elevation": 750,
        "date": "2020-09-23 11:48:00 +0200"
    }
}' "https://api.sportstracklive.com/v1/track"
http
POST /v1/track HTTP/1.1
Host: api.sportstracklive.com
Content-Type: application/json
X-STL-Token: {{token}}
X-STL-Secret-Key: {{secret_key}}

{
    "track": {
        "category_name": "paragliding",
        "track_type": "live_track"
    },
    "location": {
        "latitude": 42.458980,
        "longitude": 2.767730,
        "speed": 0,
        "bearing": 213,
        "altitude": 829,
        "elevation": 750,
        "date": "2020-09-23 11:48:00 +0200"
    }
}

Response

200 OKapplication/json; charset=utf-8

json
{
    "track": {
        "id": 10704,
        "track_type": "live_track",
        "started_at": "2020-09-23T11:49:50.000+02:00",
        "finished_at": null,
        "category": {
            "id": 1,
            "name": "paragliding"
        },
        "time_zone": null
    }
}

Keep the returned track.id — you will need it to add points and to end the live.