API Reference
add_game
Adds a new game and sends a create incident message to BOS.
POST /add_game/:create_messagecreate_message: Object of type create
Success
Failure
status: 400: Bad Requestsubcode: One ofError Objectstitle: One ofError Objectsmessage: One ofError Objects
Error Objects
var http: HttpClient;
var headers = new HttpHeaders({'Content-Type' : 'application/json'});
var postData:any = {};
postData.sport = "Soccer";
postData.league = "EPL";
postData.user = 1;
postData.home = "Chelsea";
postData.away = "Manchester United";
postData.start_time = "2020-02-04T18:33:00Z";
http.post(url + "add_game.php?" , postData, {headers}).map();start_game
Starts an existing game and sends an in_progress incident message to BOS.
POST /start_game/:in_progress_messagein_progress_message: Object of type in_progress
Success
Failure
status: 400: Bad Requestsubcode: One ofError Objectstitle: One ofError Objectsmessage: One ofError Objects
Error Objects
var http: HttpClient;
var headers = new HttpHeaders({'Content-Type' : 'application/json'});
var postData:any = {};
postData.sport = "Soccer";
postData.league = "EPL";
postData.user = 1;
postData.home = "Chelsea";
postData.away = "Manchester United";
postData.start_time = "2020-02-04T18:33:00.000Z";
postData.whistle_start_time = "2020-02-04T18:45:00.000Z";
postData.match_id: 24;
http.post(url + "start_game.php?" , postData, {headers}).map();add_score
Add scores to a game.
POST /add_score/:result_messageresult_message: Object of type result
Success
Failure
status: 400: Bad Requestsubcode: One ofError Objectstitle: One ofError Objectsmessage: One ofError Objects
Error Objects
var http: HttpClient;
var headers = new HttpHeaders({'Content-Type' : 'application/json'});
var postData:any = {};
postData.sport = "Soccer";
postData.league = "EPL";
postData.user = 1;
postData.home = "Chelsea";
postData.away = "Manchester United";
postData.start_time = "2020-02-04T18:33:00.000Z";
postData.home_score = 4;
postData.away_score = 2;
postData.match_id: 24;
http.post(url + "add_score.php?" , postData, {headers}).map();finish_game
Finish a game
finish_game_message: Object of type finish
Success
Failure
status: 400: Bad Requestsubcode: One ofError Objectstitle: One ofError Objectsmessage: One ofError Objects
Error Objects
cancel_game
Cancel a game
cancel_game_message: Object of type canceled
Success
Failure
status: 400: Bad Requestsubcode: One ofError Objectstitle: One ofError Objectsmessage: One ofError Objects
Error Objects
delete_event
Delete an event according to the league and date.
date: The date of the event. Format is YYYY-MM-DD (UTC)league: The name of the league
Success - 200
title:League Deletedmessage:[league]
Failure - 400
delete_game
Delete an event according to the league and date.
game_id: The id of the game to be deleted.
Success - 200
title:League Deletedmessage:[league]
Failure - 400
get_all_data_by_date_range
Get all games data between a date range.
start_date: The start of the date range. Format is YYYY-MM-DDTHH:MM:SS.000Zend_date: The end of the date range. Format is YYYY-MM-DDTHH:MM:SS.000Z
Success - 200
List of all games between
start_dateandend_date
Failure - 400
get_all_games
Get all games.
Success - 200
List of all games
Failure - 400
get_all_sports
Get all sports.
Success - 200
List of all sports
Failure - 400
get_games_by_league_and_date
Get all games data between a date range and for a league.
league:The sport league (event group).start: The start of the date range. Format is YYYY-MM-DDTHH:MM:SS.000Z.end: The end of the date range. Format is YYYY-MM-DDTHH:MM:SS.
Success - 200
List of all games for
leaguebetweenstartandend
Failure - 400
get_games_by_league
Get all games for a league.
get_leagues_by_sport
Get all leagues from a league.
get_sports_and_leagues
Get all sports and leagues
Success - 200
List of all sports
Failure
get_teams_by_league
Get all teams from a league.
get_league_data_by_name
Get all league information from its name.
leaguename:The name of the league.
Success - 200
All fields for the selected league
Failure - 400
last_event_id_by_date_and_league
Get the event id of the last event on a date and for the league.
date:Event date in the format YYYY-MM_DDleague:The name of the league.
Success - 200
The last event id for
leagueondate
Failure - 400
last_event_id
Get the id of the last event.
Success - 200
The last
event_idfor all leagues
Failure - 400
last_game_id_by_date_and_league
Get the game id of the last game on a date and for the league.
date:Game date in the format YYYY-MM_DDleague:The name of the league.
Success - 200
The last game id for
leagueondate
Failure - 400
last_game_id
Get the game id of the last game for all sports.
Success - 200
The last game id for all sports.
Failure - 400
last_game
Get the game details of all games sorted descending so the most recent (last) game is the first record
Success - 200
All game records sorted descending.
Failure - 400
run_replay
Run a data replay for the selected sport and league(s)
sport:The name of the sportleagues:The name of the leagues. Pipe separated list, e.g "EPL|La Liga|Serie Astart: Start date in the format YYYY-MM_DDend: End date in the format YYYY-MM_DD
Success - 200
title: Replay completedmessage: [sport]: { [league]: total, [league]: total, ... }
Failure - 400
Note: Replays can only be run for one sport at a time.
Last updated
Was this helpful?
