License Manager for WooCommerce

Easily sell and manage software license keys through your shop

Retrieve a generator

Description

Retrieves a single generator by its ID. The response contains the generator data object.

Request URL

GET/wp-json/lmfwc/v2/generators/2

Request Example (PHP)

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "{{host}}/wp-json/lmfwc/v2/generators/2?consumer_key={{consumer_key}}&consumer_secret={{consumer_secret}}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => false,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

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

curl_close($curl);

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

?>

Response

{
  "success": true,
  "data": {
    "id": "2",
    "name": "My second generator",
    "charset": "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
    "chunks": "3",
    "chunkLength": "6",
    "timesActivatedMax": "1",
    "separator": "-",
    "prefix": null,
    "suffix": null,
    "expiresIn": null,
    "createdAt": "2019-09-04 18:11:38",
    "createdBy": "1",
    "updatedAt": null,
    "updatedBy": null
  }
}