PHP code example of drinkynet / codelocks-api

1. Go to this page and download the library: Download drinkynet/codelocks-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

drinkynet / codelocks-api example snippets


$codelocks = new \drinkynet\Codelocks\Codelocks($key, $accessKey);

$netcode = $codelocks->netcode();

$netcode->lock('0000000000000000000000000000001a')->get();

$code = $netcode->lock('0000000000000000000000000000001a')
    ->date(new \DateTime('2016-09-23'))
    ->hour(9)
    ->duration(1)
    ->get();

$codelocks = new \drinkynet\Codelocks\Codelocks($key, $accessKey);

// Init sequence data with default master code
$init = $codelocks->init()
    ->lockModel('K3CONNECT')
    ->get();

// Init sequence data with custom master code
$init = $codelocks->init()
    ->lockModel('K3CONNECT')
    ->masterCode('12345678')
    ->get();

$codelocks = new \drinkynet\Codelocks\Codelocks($key, $accessKey);

// Uses the accessKey set earlier
$locks = $codelocks->lock()->get();

// Use a different accessKey associated with the API key
$locks $codelocks->lock('abcde12345')->get();