API Reference
Adds a new game and sends a create incident message to BOS.
POST /add_game/:create_message
Parameters
Response
Example
- Success
- Failure
status
: 400: Bad Requestsubcode
: One ofError Objects
title
: One ofError Objects
message
: 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();
Starts an existing game and sends an in_progress incident message to BOS.
POST /start_game/:in_progress_message
Parameters
Response
Example
- Success
- Failure
status
: 400: Bad Requestsubcode
: One ofError Objects
title
: One ofError Objects
message
: 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 scores to a game.
POST /add_score/:result_message
Parameters
Response
Example
- Success
- Failure
status
: 400: Bad Requestsubcode
: One ofError Objects
title
: One ofError Objects
message
: 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 a game
POST /finish_game/:finish_game_message
Parameters
Response
Example
- Success
- Failure
status
: 400: Bad Requestsubcode
: One ofError Objects
title
: One ofError Objects
message
: 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_end_time = "2020-02-04T20:33:00.000Z";
postData.match_id: 24;
http.post(url + "finish_game.php?" , postData, {headers}).map();
Cancel a game
POST /add_score/:cancel_game_message
Parameters
Response
Example
- Success
- Failure
status
: 400: Bad Requestsubcode
: One ofError Objects
title
: One ofError Objects
message
: 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.match_id: 24;
http.post(url + "cancel_game.php" , postData, {headers}).map();
Delete an event according to the league and date.
DELETE /delete_event/:date/:league
Parameters
Response
Example
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
var http: HttpClient;
var headers = new HttpHeaders({'Content-Type' : 'application/x-www-form-urlencoded'});
let httpParams = new HttpParams().set('date', '2020-02-29', 'league', 'EPL');
return http.delete(url + "delete_event.php", {
params: httpParams, headers: headers});
Delete an event according to the league and date.
DELETE /delete_game/:game_id
Parameters
Response
Example
game_id
: The id of the game to be deleted.
- Success - 200
title:
League Deletedmessage:
[league]
- Failure - 400
var http: HttpClient;
var headers = new HttpHeaders({'Content-Type' : 'application/x-www-form-urlencoded'});
let httpParams = new HttpParams().set('game_id', 24);
return this.http.delete(this.url + "delete_game.php", {
params: httpParams, headers: headers});
Get all games data between a date range.
GET /get_all_data_by_date_range/:start_date/:end_date
Parameters
Response
Example
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_date
andend_date
- Failure - 400
http.get(url + "get_all_data_by_date_range.php", {
params:{startdate: "2020-02-19T12:00:00.000Z",
enddate: "2020-02-29T12:00:00.000Z"}}).map();
Get all games.
GET /get_all_games/
Response
Example
- Success - 200
- List of all games
- Failure - 400
http.get(url + "get_all_games.php").map()
Get all sports.
GET /get_all_sports/
Response
Example
- Success - 200
- List of all sports
- Failure - 400
http.get(url + "get_all_sports.php").map()
Get all games data between a date range and for a league.
GET /get_games_by_league_and_date/:league/:start_date/:end_date
Parameters
Response
Example
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
league
betweenstart
andend
- Failure - 400
http.get(url + "get_games_by_league_and_date.php", {
params:{league: "NFL",
startdate: "2020-02-19T12:00:00.000Z",
enddate: "2020-02-29T12:00:00.000Z"}}).map();
Get all games for a league.
GET /get_games_by_league/:league
Parameters
Response
Example
league:
The league (event group).
- Success - 200
- List of all games for
league
- Failure - 400
http.get(url + "get_games_by_league.php", {
params:{league: "NFL" }}).map();
Get all leagues from a league.
GET /get_leagues_by_sport/:sport
Parameters
Response
Example
sport:
The id of the sport.
- Success - 200
- List of all leagues for
sport
- Failure - 400
http.get(url + "get_leagues_by_sport.php", {
params:{sport: 0}}).map();
Get all sports and leagues
GET /get_sports_and_leagues/
Response
Example
- Success - 200
- List of all sports
- Failure
http.get(url + "get_sports_and_leagues.php").map()
Get all teams from a league.
GET /get_teams_by_league/:league
Parameters
Response
Example
league:
The id of the league.
- Success - 200
- List of all teams for the
league
- Failure - 400
http.get(url + "get_teams_by_league.php", {
params:{league: 1}}).map();
Get all league information from its name.
GET /get_league_data_by_name/:leaguename
Parameters
Response
leaguename:
The name of the league.
- Success - 200
- All fields for the selected league
- Failure - 400
Get the event id of the last event on a date and for the league.
GET /last_event_id_by_date_and_league/:date/:league
Parameters
Response
Example
date:
Event date in the format YYYY-MM_DDleague:
The name of the league.
- Success - 200
- The last event id for
league
ondate
- Failure - 400
http.get(url + "last_event_id_by_date_and_league.php", {
params:{
date: "2020-02-29",
league: 1}}).map();
Get the id of the last event.
GET /last_event_id/
Parameters
Example
- Success - 200
- The last
event_id
for all leagues
- Failure - 400
http.get(url + "last_event_id.php").map()
Get the game id of the last game on a date and for the league.
GET /last_game_id_by_date_and_league/:date/:league
Parameters
Response
Example
date:
Game date in the format YYYY-MM_DDleague:
The name of the league.
- Success - 200
- The last game id for
league
ondate
- Failure - 400
http.get(url + "last_game_id_by_date_and_league.php", {
params:{
date: "2020-02-29",
league: 1}}).map();
Get the game id of the last game for all sports.
GET /last_game_id
Response
Example
- Success - 200
- The last game id for all sports.
- Failure - 400
http.get(url + "last_game_id.php").map();
Get the game details of all games sorted descending so the most recent (last) game is the first record
GET /last_game
Response
Example
- Success - 200
- All game records sorted descending.
- Failure - 400
http.get(url + "last_game").map();
Run a data replay for the selected sport and league(s)
GET /run_replay/:sport/:leagues/:start/:end
Parameters
Response
Example
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
http.get(url + "run_replay.php", {params:{
sport: "Soccer",
leagues: "EPL | La Liga",
start: "2020-02-01",
end: "2020-01-08"}}).map();
Note: Replays can only be run for one sport at a time.
Last modified 1yr ago