Skip to content

First API call

Bryan Böhnke-Avan edited this page May 19, 2026 · 1 revision

First API call

This guide help you sending your first API request.

Prepare environment

  1. Follow steps in Installation Guide
  2. Use the autoloader/loader file
  3. Use the following snippet:
<?php
# ... (require)
use Cryptolens_PHP_Client\Cryptolens;
use Cryptolens_PHP_Client\Key;

$c = new Cryptolens("YOUR_TOKEN", 12345, Cryptolens::CRYPTOLENS_OUTPUT_JSON);
$k = new Key($c);

# send requests
$license_key = "XXXXX-XXXXX-XXXXX-XXXXX";
$machineId = $k->getMachineId();
print_r("Key activated:" . var_dump($k->activate($license_key, $machineId)));

// or

$c->key()->activate($key, $c->key()->getMachineId());

?>

Clone this wiki locally