League

Returns league data for a specified league. The authenticated user must be the league owner. A league ID {LID} parameter is required for this endpoint. The {LID} can be retrieved from the League List endpoint response.

Method URI
GET https://roadleagues.com/api/v1/league?token={ACCESS-TOKEN}&lid={LID}
POST https://roadleagues.com/api/v1/league


Required POST Headers

{
  "Accept"        : "application/json",
  "Content-Type"  : "application/x-www-form-urlencoded",
  "Authorization" : "Bearer {ACCESS-TOKEN}"
}


POST Data Parameters

"lid" : "{LID}", // Required - Integer


Example Response

{
    "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"
    },
    "extra": {
        "api_author": "Richie McMullen",
        "api_version": "v1",
        "api_rate_limit": null,
        "current_limit_count": null
    }
}

Example Requests

{primary} A couple of examples using Ajax & PHP cURL on how you might go about making a POST request for this endpoint. Remember to replace the placeholders with your own credentials.

Example POST Request - Ajax

$.ajax({
  type: "POST",
  url: "https://roadleagues.com/api/v1/league",
  data: {
    "lid": "{LID}", // Required
  },
  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);
  }
});


Example POST Request - PHP cURL

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => "https://roadleagues.com/api/v1/league",
  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 => "lid={LID}", // Required
  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;