Skip to content

Sample Folder Guide

Michel edited this page Nov 5, 2024 · 1 revision

Sample Folder Guide

The Sample Folder contains all the example code files needed to interact with the SLM Plus license management API. Each file demonstrates how to perform a specific action, including creating, activating, deactivating, checking, and retrieving license information. This guide will walk you through the files in the Sample Folder and how to use them.

Sample Files Overview

Each sample file is self-contained, making it easy to integrate directly into your PHP projects or modify as needed. Here’s a list of the files included and a brief description of each:

  • CoreConfig.php: Contains global settings, constants, and utility methods for API requests and responses.
  • LicenseAPI.php: Acts as an API wrapper with methods for each license management action, using CoreConfig.php to send requests.
  • Action Files:
    • CreateLicense.php: Contains code to create a new license.
    • ActivateLicense.php: Handles license activation for a specific domain or device.
    • DeactivateLicense.php: Manages deactivation of a license from a domain or device.
    • CheckLicense.php: Checks the current status of a license.
    • GetLicenseInfo.php: Retrieves detailed information about a license.

How to Use the Sample Files

Each sample file includes an example usage section to help you get started quickly. To use any sample file:

  1. Configure Core Settings: Before using any sample, open CoreConfig.php and set your API_URL and SECRET_KEY values to match the settings from your SLM Plus installation.
  2. Run an Action: Open the desired action file (e.g., CreateLicense.php), adjust any necessary parameters (such as license_key or registered_domain), and run the script.
  3. Handle Responses: Each file will output a response message based on the API action’s success or failure, letting you know if the action was completed successfully or if further troubleshooting is required.

Tip: For consistent integration, start with CoreConfig.php to ensure that all API requests are securely configured.

Additional Resources

For details on each action, refer to our sample wiki pages.

Troubleshooting and Support

If you encounter issues or need clarification, consult the Return Codes and Messages page to interpret API responses or refer to the Troubleshooting Guide (if available) for additional help.

By using the Sample Folder, you can quickly implement secure license management in your projects with minimal setup and modification.