1 Retrieving License Information
Michel edited this page 2024-11-04 19:01:39 -05:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Retrieving License Information

The GetLicenseInfo.php file allows you to retrieve comprehensive details about a license, such as the registered users 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. Heres 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. Heres what to expect:

  • Basic Information: Displays basic information, such as the license key, status, registered users 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 users 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 youve configured and tested retrieving license information, you can use this feature to manage and review license details for users effectively.