Examples & Tutorials

Authentication

Note that all the examples below are from the Linux command line but since all API calls are HTTP requests, the API can be accessed similarly with any language that supports HTTP.

The first step is to use your credentials to obtain a token and get your user id:

curl -s -X POST -H 'Content-Type: application/json' \
https://api.signality.com/v4/users/login \
-d '{"username":"my_username","password":"my_password"}'

This will return a JSON message with a token and your user id similar to this one:

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}

See the API reference for mode details.

API Queries

In the examples below, it’s assumed that the variables token and user_id are set (see Authentication section above).

List Available Games

curl -X GET -H "Authorization: Bearer $token" \
https://api.signality.com/v4/games

This will return a JSON document containing a list of games, each one with an identifier id as described here.

Get Phase Information

curl -X GET -H "Authorization: Bearer $token" \
https://api.signality.com/v4/games/$game_id/phases

This will return a JSON document containing a list of phases for the game, each one with an identifier id as described here.

Download Data

Download events data for phase 1:

curl -s -X GET -H "Authorization: Bearer $token" -H "Accept: application/gzip" \
https://api.signality.com/v4/games/$game_id/phases/1/events > events.json.gz

This will return a JSON document containing a list of events for phase 1 as described here.

Download tracks data for phase 1:

curl -s -X GET -H "Authorization: Bearer $token" -H "Accept: application/gzip" \
https://api.signality.com/v4/games/$game_id/phases/1/tracks > tracks.json.gz

This will return a JSON document containing a list of tracks for phase 1 as described here.

Download stats data for phase 1:

curl -s -X GET -H "Authorization: Bearer $token" -H "Accept: application/gzip" \
https://api.signality.com/v4/games/$game_id/phases/1/stats > stats.json.gz

This will return a JSON document containing a list of stats for phase 1 as described here.