4.1. GetLeagues

This method retrieves the list of leagues from the system.

 

Request

Method

URL

Method

URL

GET

/AsianOddsService/GetLeagues?sportsType={SportsType}&marketTypeId={marketTypeId}&bookies={ALL|List of Bookies}&since={since}

Type

Params

Values

Type

Params

Values

HEADER

AOToken

string

HEADER

Accept

application/json

QUERY STRING

bookies

string

QUERY STRING

sportsType

Int

QUERY STRING

marketTypeId

Int

QUERY STRING

since

long

 

Request Values

Value

What is this for

Value

What is this for

AOToken

Token generated also by the Login method. This token identifies which user is requesting or executing the API Method. This has to be sent for all of the request except during execution of the Login method

accept

application/json

bookies(optional)

List of Bookies separated by comma(,). If you want all bookies, then please use ALL keyword. Note that this is an optional field and without any value means that you have chosen ALL bookies.

sportsType(optional)

Type of sports of which leagues to display. If none specified, then by default all will be shown. SportsType can be retrieved by calling GetSports.

marketTypeId(required)

MarketTypeId refers to the type of market. Valid Values are {0,1,2}
0 : Live Market
1 : Today Market
2 : Early Market
If MarketTypeId is not specified, then 0 is the default value.

since(optional)

Since is a delta switch. The value expected is a milliseconds since last epoch. When specified, the data returned are only the data that was generated since the value of this. This is normally used to return subset of data that have been updated.
When this parameter is not specified then all of the data will be returned.

 

Response Values

Value

What is this for

Value

What is this for

Code

Holds the status of the response. If it’s 0, then it is successful. Negative values indicate failure

Bookies

Bookies for the particular league

LeagueID

Unique identification of League

LeagueName

Name of the League

SportsType

Sports type

Since

Last Updated Date in Milliseconds since epoch

MarketTypeId

MarketType of the League where it is part of. Value can be any of the below :
0 -Live Market
1 -Today market
2 -Early Market

 

Sample JSON Response

Response Type

Response

Response Type

Response

Success

Code: 0,
"Result": {
"Sports": [
{
"League": [
{
"Bookies": [
"ISN",
"IBC",
"SIN"
],
"LeagueId": -1733936463,
"LeagueName": "VIETNAM CHAMPIONSHIP U21 QUALIFIERS",
"MarketTypeId": 0,
"Since": 1476184438938
},
{
"Bookies": [
"ISN",
"IBC",
"SIN",
"SBO"
],
"LeagueId": 1332151953,
"LeagueName": "BRICS CUP U17",
"MarketTypeId": 0,
"Since": 1476184441682
},
{
"Bookies": [
"ISN",
"IBC",
"SIN",
"SBO"
],
"LeagueId": 10759462,
"LeagueName": "INDIA GOA LEAGUE U20",
"MarketTypeId": 0,
"Since": 1476184441806
},
{
"Bookies": [
"ISN",
"IBC",
"SIN",
"SBO"
],
"LeagueId": -208733113,
"LeagueName": "RUSSIA 2ND DIVISION",
"MarketTypeId": 0,
"Since": 1476184439071
},
{
"Bookies": [
"ISN",
"IBC",
"SIN",
"SBO"
],
"LeagueId": -814329617,
"LeagueName": "RUSSIA DIVISION 2",
"MarketTypeId": 0,
"Since": 1476184441196
}
],
"SportsType": 1
}
]
}
}

Fail

{
"Code": -1,
"Result": null
}