beta GetOutrights push - Saba-sports/OddsDirectAPI GitHub Wiki

This API is to get outright information.

  • Subscribing to updates and retrieving data in one request via this API.

Request

GET  /sports/stream/{version}/GetOutrights?language=cs
Accept: text/event-stream
Accept-Encoding: br, gzip, deflate(If Header is available)
Parameter Description
query Specific the query parameters for using odata query format
from Specific the start date of the data. It can be inputted separately
until Specific the end date of the data. It can be inputted separately
language Specific the language of the response content
token Get the JWT token through /login or /refreshToken

Response

id: long\r\n
data: {
    "status": int,
    "message":string,
    "payload": {
        "outrights":{
            "add": Outright[],
            "change":OutrightChange[],
            "remove":[leagueId1,leagueId2...]
        }   
    }
}\r\n
Name Format Description
id string Specifies the serial number of Server Sent Event
data json

Data object

Name Format Description
status int Specifies the status code of the response.
message string Specifies the message of the status.
payload object

Payload object

Name Format Description
outrights object Specifies the information of outrights.
Outrights object
Name Format Description
add Outright array Specifies the outright information which be added.
- Outright class please reference GetOutrights response.
change OutrightChange array Specifies the outright information which be updated.
- OutrightChange class please reference OutrightChange.
remove int array Specifies the identified of the league which be removed.
{
	"sportType": int,
	"sportName": string,
	"leagueId": int,
	"leagueName": string,
	"eventCode": string,
	"lDisplayMode": int,
	"eventDate": DateTime,
	"eventStatus": string,
	"isTest": bool,
	"leagueGroup": string,
	"teams": Team[]
}
Name Format Description Queryable Query Example
sportType int Specifies the identifier of the sport. Yes $filter=sporttype eq 1
sportName string Specifies the name of the sport. Yes $filter=sportname eq 'Soccer'
leagueId int Specifies the identifier of the league. Yes $filter=leagueid eq 93816
leagueName string Specifies the name of the league. Yes $filter=leaguename eq '*UEFA EURO 2020 - WINNER' or $filter=contains(leaguename,'UEFA')
eventCode string Specifies the order of the event. No
lDisplayMode int Specifies the display mode of league.
0:All;
1:Olympic
2:World Cup
3:Euro
4:Winter Olympic
5:COPA America
No
eventDate DateTime Specifies the date and time of the beginning of the event. No
eventStatus string Specifies the status of the event.
running/closed
No
isTest bool Specifies whether the event is test. No
leagueGroup string Specifies the group of the league. (EN) No
teams Teams Specifies the information of outright teams. No

Teams

{
	"orid": int,
	"teamId": int,
	"teamName": string,
	"price": decimal,
	"maxBet": int,
	"oddsStatus": string,
	"isUpdate": bool
}
Name Format Description Queryable Query Example
orid int Specifies the identifier of the outright. No
teamId int Specifies the identifier of the team. No
teamName string Specifies the name of the team. No
price decimal Specifies the odds price of this team. (DEC) No
maxBet int Specifies the maximum bet amount for this team. No
oddsStatus string Specifies the status of the odds.
running/closed
No
isUpdate bool Specifies whether the odds be updated. No

Status Enumeration

status message Description
0 Success Connect success and continue to get the updated data.
1 InitialData First time to connect and get initial data.
3 Reset Reset connection.
97 Invalid Accept-Encoding Http Status Code = 400
The encoding compression format is invalid.
98 Invalid OData query attributes Http Status Code = 400
The Odata query attributes are invalid or not support.
99 System under maintenance Http Status Code = 503
System is under maintenance.
100 Internal Server Error Http Status Code = 500
The server encountered an unexpected condition that prevented it from fulfilling the request.
  • It will return status=1 when the first time to connect, and the initial data will be in the add class; the updated data with status=0 will continue to be received in add/change/remove classes.

  • If the user disconnects due to the network or other issue:
    • If using browser native javascript EventSource api, without closing the page, the browser will auto-reconnect and add Last-Event-Id in the header. Server will base on the Last-Event-Id and resend the missing data to client.
    • If using other languages or frameworks, need to create the reconnection mechanism and add Last-Event-Id into the header by themselves.
    • If cannot find the Last-Event-Id, it will reset the connection by status=3, and the data is initial data.
⚠️ **GitHub.com Fallback** ⚠️