Returns a league list for the authenticated RoadLeagues user.
Method | URI |
---|---|
GET |
https://roadleagues.com/api/v1/leagues?token={ACCESS-TOKEN}&paginate=20 |
POST |
https://roadleagues.com/api/v1/leagues |
POST
Headers{
"Accept" : "application/json",
"Content-Type" : "application/x-www-form-urlencoded",
"Authorization" : "Bearer {ACCESS-TOKEN}"
}
POST
Data Parameters"paginate" : "20" // Optional - Integer
{
"data": [
{
"lid": 1,
"ownerID": 1,
"leagueName": "League One",
"leagueSlug": "league-one",
"leagueStatus": "active",
"leagueLogo": null,
"leagueBanner": null,
"leagueLeaderboard": null,
"leagueResultsDisplay": "no",
"allowOnlineSignOn": "no",
"infoPageText": null,
"infoPageStatus": null,
"videoViewingMode": "lightbox",
"creationDate": "2020-02-23 21:12:45",
"lastUpdated": "2020-02-24 21:10:22"
},
{
"lid": 2,
"ownerID": 1,
"leagueName": "League Two",
"leagueSlug": "league-two",
"leagueStatus": "active",
"leagueLogo": "https://roadleagues.com/uploads/league/logo/h0ZqP4tOpHYTBf7cbg.jpg",
"leagueBanner": "https://roadleagues.com/uploads/league/banner/ZqP4t9LOpHYTBf7cbg.jpg",
"leagueLeaderboard": "https://roadleagues.com/uploads/league/leaderboard/pXWyJpGSgpqh7gPLEt.jpg",
"leagueResultsDisplay": "no",
"allowOnlineSignOn": "no",
"infoPageText": null,
"infoPageStatus": null,
"videoViewingMode": "lightbox",
"creationDate": "2020-03-30 08:46:39",
"lastUpdated": "2020-03-30 08:46:39"
}
],
"links": {
"first": "https://roadleagues.com/api/v1/leagues?page=1",
"last": "https://roadleagues.com/api/v1/leagues?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "https://roadleagues.com/api/v1/leagues",
"per_page": 20,
"to": 4,
"total": 4
},
"extra": {
"api_author": "Richie McMullen",
"api_version": "v1",
"api_rate_limit": null,
"current_limit_count": null
}
}
{primary} A couple of examples using
Ajax
&PHP cURL
on how you might go about making aPOST
request for this endpoint. Remember to replace the placeholders with your own credentials.
$.ajax({
type: "POST",
url: "https://roadleagues.com/api/v1/leagues",
data: {
"paginate": "20", // Optional
},
headers: {
"Accept": 'application/json',
"Content-Type": 'application/x-www-form-urlencoded',
"Authorization": 'Bearer {ACCESS-TOKEN}',
},
dataType: "JSON",
cache: false,
success: function (data) {
console.log(data);
}
});
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://roadleagues.com/api/v1/leagues",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "paginate=20", // Optional
CURLOPT_HTTPHEADER => array(
"Accept: application/json",
"Content-Type: application/x-www-form-urlencoded",
"Authorization: Bearer {ACCESS-TOKEN}"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;