Retrieve log data for a specific user and lock.

Resource URL

https://api.chastikey.com/v0.5/logdata.php

Parameters

ParameterDescriptionOptionalDefault
ClientID ClientID is assigned to the API project that you create within the ChastiKey app.
ClientSecret ClientSecret is assigned to the API project that you create within the ChastiKey app. It can be re-generated within the app if needed.
DiscordID The Discord ID of the account that you want to return data for. This is required unless you're sending the users username instead.
Username The username of the account that you want to return data for. This is required unless you're sending the users DiscordID instead.
LockID The ID of the lock the log is attached to. Both LockID and LogID are required.
LogID The ID of the log you want to view. Both LockID and LogID are required.
Limit A number of log data items to return. Will return all if not included, or left blank. True
Since A timestamp to filter all log data items from. Will return all if not included, or left blank. True

Example

POST https://api.chastikey.com/v0.5/logdata.php

Request

  
    $curl = curl_init();

    curl_setopt_array($curl, array(
        CURLOPT_URL => "https://api.chastikey.com/v0.5/logdata.php",
        CURLOPT_HTTPHEADER => array(
            "ClientID: gvg3n9gzxmao21gpz143ij0yhn4gqalw",
            "ClientSecret: h3px2ifybw076n9qp3vr2gk5uvaolsks"
        ),
        CURLOPT_CUSTOMREQUEST => "POST",
        CURLOPT_POSTFIELDS => array(
            "Username" => "JohnDoe",
            "LockID" => 1579399247,
            "LogID" => 1579399248
        ),
        CURLOPT_RETURNTRANSFER => TRUE,
        CURLOPT_FRESH_CONNECT => TRUE
    ));

    $response = curl_exec($curl);
    $err = curl_error($curl);

    curl_close($curl);

    if ($err) {
        echo "cURL Error #:".$err;
    } else {
        echo $response;
    }  

Success Response

  {
    "response": {
        "status": 200,
        "message": "the request has succeeded",
        "timestampGenerated": 1579566718
    },
    "query": {
        "discordID": "",
        "limit": 0,
        "lockID": 1579399247,
        "logID": 1579399248,
        "since": 0,
        "username": "JohnDoe"
    },
    "log": [
        {
            "id": 33959,
            "action": "StartedLock",
            "actionedBy": "Lockee",
            "hidden": 0,
            "result": "",
            "timestamp": 1579399248
        },
        {
            "id": 33960,
            "action": "SetMoodEmoji",
            "actionedBy": "Lockee",
            "hidden": 0,
            "result": "Emoji=61,Colour=1",
            "timestamp": 1579399293
        },
        {
            "id": 33964,
            "action": "KeyholderUpdate",
            "actionedBy": "Keyholder",
            "hidden": 0,
            "result": "HidTimer",
            "timestamp": 1579399879
        },
        {
            "id": 34027,
            "action": "RemovedTime",
            "actionedBy": "Keyholder",
            "hidden": 1,
            "result": "",
            "timestamp": 1579414884
        },
        {
            "id": 34243,
            "action": "AddedTime",
            "actionedBy": "Keyholder",
            "hidden": 1,
            "result": "",
            "timestamp": 1579437681
        },
        {
            "id": 34553,
            "action": "AddedTime",
            "actionedBy": "Keyholder",
            "hidden": 1,
            "result": "",
            "timestamp": 1579458702
        },
        {
            "id": 35073,
            "action": "AddedTime",
            "actionedBy": "Keyholder",
            "hidden": 1,
            "result": "",
            "timestamp": 1579518684
        },
        {
            "id": 35434,
            "action": "KeyholderFreezeStarted",
            "actionedBy": "Keyholder",
            "hidden": 0,
            "result": "FrozeLock",
            "timestamp": 1579551081
        }
    ]
}  

Error Response

  {
    "response": {
        "status": 400,
        "message": "required postdata missing: lockid",
        "timestampGenerated": 1579566796
    }
}  

Response Status Codes

CodeDescription
200 OK - The request has succeeded. The client can read the result of the request in the body and the headers of the response.
204 No Content - The request has succeeded but returns no message body.
400 Bad Request - The request could not be understood by the server due to malformed syntax. The message body will contain more information.
401 Unauthorized - The request requires user authentication or, if the request included authorization credentials, authorization has been refused for those credentials.
403 Forbidden - The server understood the request, but is either refusing to fulfill it, or the specific data you're requesting is private.
429 Too Many Requests - Rate limiting has been applied.

Resource Information

Rate Limited True
Response Format JSON
Authentication Tokens