Retrieve locks and their configurations if they have simulation data attached to them.

Resource URL

https://api.chastikey.com/v0.5/simulationdata.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.
MinMinutes Filter simulation data where the average minutes locked is greater than or equal to this field. True
MaxMinutes Filter simulation data where the average minutes locked is less than or equal to this field. True

Example

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

Request

  
    $curl = curl_init();

    curl_setopt_array($curl, array(
        CURLOPT_URL => "https://api.chastikey.com/v0.5/simulationdata.php",
        CURLOPT_HTTPHEADER => array(
            "ClientID: gvg3n9gzxmao21gpz143ij0yhn4gqalw",
            "ClientSecret: h3px2ifybw076n9qp3vr2gk5uvaolsks"
        ),
        CURLOPT_CUSTOMREQUEST => "POST",
        CURLOPT_POSTFIELDS => array(
            "MinMinutes" => 60,
            "MaxMinutes" => 480
        ),
        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": 1579568281
    },
    "locks": [
        {
            "userID": -9,
            "username": "",
            "discordID": "",
            "lockName": "",
            "sharedLockID": "",
            "sharedLockQRCode": "",
            "sharedLockURL": "",
            "autoResetFrequencyInSeconds": 0,
            "maxAutoResets": 0,
            "maxDoubleUps": 0,
            "maxFreezes": 0,
            "maxGreens": 1,
            "maxReds": 23,
            "maxResets": 0,
            "maxYellows": 0,
            "maxYellowsAdd": 0,
            "maxYellowsMinus": 0,
            "minDoubleUps": 0,
            "minFreezes": 0,
            "minGreens": 1,
            "minReds": 23,
            "minResets": 0,
            "minYellows": 0,
            "minYellowsAdd": 0,
            "minYellowsMinus": 0,
            "multipleGreensRequired": 0,
            "regularity": 0.25,
            "simulationAverageMinutesLocked": 171,
            "simulationBestCaseMinutesLocked": 15,
            "simulationWorstCaseMinutesLocked": 345
        },
        {
            "userID": -9,
            "username": "",
            "discordID": "",
            "lockName": "",
            "sharedLockID": "",
            "sharedLockQRCode": "",
            "sharedLockURL": "",
            "autoResetFrequencyInSeconds": 0,
            "maxAutoResets": 0,
            "maxDoubleUps": 1,
            "maxFreezes": 0,
            "maxGreens": 2,
            "maxReds": 18,
            "maxResets": 1,
            "maxYellows": 9,
            "maxYellowsAdd": 0,
            "maxYellowsMinus": 0,
            "minDoubleUps": 1,
            "minFreezes": 0,
            "minGreens": 2,
            "minReds": 6,
            "minResets": 1,
            "minYellows": 9,
            "minYellowsAdd": 0,
            "minYellowsMinus": 0,
            "multipleGreensRequired": 1,
            "regularity": 0.5,
            "simulationAverageMinutesLocked": 426,
            "simulationBestCaseMinutesLocked": 150,
            "simulationWorstCaseMinutesLocked": 1080
        }
    ]
}  

Error Response

  {
    "response": {
        "status": 400,
        "message": "invalid client secret",
        "timestampGenerated": 1579568365
    }
}  

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