User Account

Returns user account data for the authenticated user.

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


Required POST Headers

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


POST Parameters

Not required for this endpoint


Example Response

{
    "data": {
        "uid": 1,
        "name": "Richard McMullen",
        "email": "xxx-xxx@gmail.com",
        "avatar": "https://roadleagues.com/uploads/user/avatar/1/EN28HE9KZ9zhsbDKDtBW.jpg",
        "subscription": "yes",
        "subscriptionEnd": "2021-01-13 16:06:57",
        "registeredDate": "2019-08-03 15:17:18",
        "lastUpdated": "2020-03-31 18:13:14"
    },
    "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/me",
  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/me",
  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_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;