Skip to content

Retrieving License Information

Michel edited this page Nov 5, 2024 · 1 revision

Retrieving License Information

The GetLicenseInfo.php file allows you to retrieve comprehensive details about a license, such as the registered user’s name, email, status, associated domains, and devices. This guide will walk you through configuring and using GetLicenseInfo.php to obtain detailed license information.

Prerequisites

  • Ensure CoreConfig.php is configured with your API URL and secret key.
  • Verify that LicenseAPI.php is included in your project, as it provides the core method for retrieving license information.

How to Use GetLicenseInfo.php

Step 1: Set Up the License Data

  1. Open GetLicenseInfo.php.
  2. Define the license key for which you want to retrieve information by setting up a simple associative array:
   $licenseData = [
       'license_key' => 'YOUR_LICENSE_KEY'  // The license key for which to retrieve information
   ];

Replace 'YOUR_LICENSE_KEY' with the actual license key.

Step 2: Call the retrieve Method

  1. Instantiate GetLicenseInfo.

  2. Call the retrieve() method with the $licenseData array. Here’s how:

    require_once 'GetLicenseInfo.php';

    $getLicenseInfo = new GetLicenseInfo(); $getLicenseInfo->retrieve($licenseData['license_key']);

    This sends a request to retrieve detailed information about the specified license key.

Step 3: Handle the Response

GetLicenseInfo.php provides a response with details about the license. Here’s what to expect:

  • Basic Information: Displays basic information, such as the license key, status, registered user’s name, and email.
  • Product and Date Info: Shows product reference, creation date, and expiry date if available.
  • Associated Domains and Devices: Lists any domains or devices associated with the license, if applicable.

Example Usage

Below is a complete example of using GetLicenseInfo.php to retrieve license details:

   require_once 'GetLicenseInfo.php';

   $licenseData = [
      'license_key' => 'YOUR_LICENSE_KEY'
   ];

   $getLicenseInfo = new GetLicenseInfo();
   $getLicenseInfo->retrieve($licenseData['license_key']); 

License Information Responses

The GetLicenseInfo.php script provides comprehensive license information, including:

  • License Key: Displays the license key.
  • Status: Indicates if the license is active, expired, or blocked.
  • User Information: Shows the registered user’s first name, last name, email, and company if available.
  • Product and Date Information: Displays the product reference, creation date, and expiry date.
  • Registered Domains: Lists any domains associated with the license.
  • Registered Devices: Lists any devices registered to the license.

For a more detailed breakdown of the response structure, review the code in GetLicenseInfo.php.

Conclusion

Once you’ve configured and tested retrieving license information, you can use this feature to manage and review license details for users effectively.