Retrieve previous combinations for a specific user.

Resource URL

https://api.chastikey.com/v0.5/combinations.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.
IncludeTestLocks Accepts the values: 1, or True. If set as true and the API tokens belong to the user account that is being queried it will also return combinations for all of the test locks for the user. True
Username The username of the account that you want to return data for. This is required unless you're sending the users DiscordID instead.

Example

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

Request

  
    $curl = curl_init();

    curl_setopt_array($curl, array(
        CURLOPT_URL => "https://api.chastikey.com/v0.5/combinations.php",
        CURLOPT_HTTPHEADER => array(
            "ClientID: gvg3n9gzxmao21gpz143ij0yhn4gqalw",
            "ClientSecret: h3px2ifybw076n9qp3vr2gk5uvaolsks"
        ),
        CURLOPT_CUSTOMREQUEST => "POST",
        CURLOPT_POSTFIELDS => array(
            "Username" => "JohnDoe"
        ),
        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": 1579564427
    },
    "locks": [
        {
            "lockGroupID": 1578756739,
            "lockID": 1578756739,
            "lockedBy": "Zoe",
            "lockName": "",
            "build": 155,
            "combination": "78613795",
            "test": 0,
            "timestampUnlocked": 1578765721
        },
        {
            "lockGroupID": 1578738589,
            "lockID": 157873858901,
            "lockedBy": "Hailey",
            "lockName": "",
            "build": 195,
            "combination": "90539198",
            "test": 0,
            "timestampUnlocked": 1578751314
        },
        {
            "lockGroupID": 1575814271,
            "lockID": 157581427101,
            "lockedBy": "Zoe",
            "lockName": "",
            "build": 198,
            "combination": "1541159900",
            "test": 0,
            "timestampUnlocked": 1575995745
        }
    ]
}  

Error Response

  {
    "response": {
        "status": 400,
        "message": "required postdata missing: username or discordid",
        "timestampGenerated": 1579564951
    }
}  

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