Skip to content

Instantly share code, notes, and snippets.

@anttti
Last active November 4, 2015 19:08
Show Gist options
  • Select an option

  • Save anttti/3d7d5638a26671d45bbd to your computer and use it in GitHub Desktop.

Select an option

Save anttti/3d7d5638a26671d45bbd to your computer and use it in GitHub Desktop.
RaceTime API draft

RaceTime API

All URLs prefixed with /v1

GET /track/

Retrieve all tracks.

{
    tracks: [
        {
            id: 0,
            name: "Alastaro",
            gameName: "Forza",
            carName: "BMW M3 2015"
        },
        {
            ...
        }
    ] 
}

GET /track/:id

Retrieve a single track and its leaderboard.

URL parameters:

  • count: How many entries should be included (max). Default: 10
  • order: Ascending or descending order: asc, desc. Default: asc
  • sortBy: Property to sort by: time, name, date. Default: time
{
    id: 0,
    name: "Alastaro",
    gameName: "Forza",
    carName: "BMW M3 2015"
    times: [
        {
            id: 0,
            time: 12321312, // in milliseconds
            name: "Ralli-Pekka",
            date: "2015-11-01"
        },
        {
            ...
        }
    ] 
}

POST /track/:id

Post an entry to a track

{
    time: 12321312, // in milliseconds
    name: "Ralli-Pekka",
    date: "2015-11-01"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment