### API Response Examples for License Status Source: https://docs.scodeware.com/resource/woocommerce-license-manager-api-version-3-get-license-status These examples illustrate the different JSON responses you might receive from the Get License Status endpoint. They cover scenarios such as invalid license keys, errors due to user permissions, and successful retrieval of license status. ```json { "response": { "result": "error", "code": "100", "message": "Invalid license key", "api_timestamp": 'current timestamp' }, "signature": "Signature or OpenSSL error" } ``` ```json { "response": { "license_status": "inactive", "api_timestamp": 'current timestamp' }, "signature": "Signature or OpenSSL error" } ``` ```json { "response": { "result": "error", "code": "900", "message": "The authenticated user doesn't own this license key", "api_timestamp": 'current timestamp' }, "signature": "Signature or OpenSSL error" } ``` ```json { "code": "rest_forbidden", "message": "Sorry, you are not allowed to do that.", "data": { "status": 403 } } ``` -------------------------------- ### API Response Examples for Get License Details Source: https://docs.scodeware.com/resource/woocommerce-license-manager-api-version-3-get-license-details These JSON structures represent possible responses from the 'Get License Details' API endpoint. They cover scenarios like an invalid license key, successful retrieval of license data (including status, dates, and meta information), and an error when the authenticated user does not own the requested license key. ```json { "response": { "result": "error", "code": "100", "message": "Invalid license key", "api_timestamp": 'current timestamp' }, "signature": "Signature or OpenSSL error" } ``` ```json { "response": { "license_id": "453", "product_id": "236", "variation_id": "0", "license_key": "FFFF-FFFF-FFFF-FFFF", "image_license_key": null, "license_status": "inactive", "owner_first_name": "Test", "owner_last_name": "Test", "owner_email_address": "contact@domain.ltd", "activation_date": "2021-04-13", "creation_date": "2021-04-13", "expiration_date": "2022-04-12", "valid": "365", "order_id": "259", "product_name": "Product name", "variation_name": "Variation name", "sold_date": "2021-04-12", "delivery_limit": "1", "remaining_delivery_times": "1", "activation_limit": "3", "remaining_activations": "3", "device_ids": [ "domain.ltd", "domain2.ltd" ], "license_key_meta": [ { "id": "15", "meta_key": "example_key_1", "meta_value": "example value 1" }, { "id": "16", "meta_key": "example_key_2", "meta_value": "example value 2" } ], "api_timestamp": 'current timestamp' }, "signature": "Signature or OpenSSL error" } ``` ```json { "response": { "result": "error", "code": "900", "message": "The authenticated user doesn't own this license key", "api_timestamp": 'current timestamp' }, "signature": "Signature or OpenSSL error" } ``` -------------------------------- ### API Response Example for User Licenses Source: https://docs.scodeware.com/resource/woocommerce-license-manager-api-version-3-get-current-user-licenses This is an example of a successful API response when retrieving licenses for a user. It includes an array of license objects, each containing details like license ID, product ID, license key, status, and associated order information. The response also includes a timestamp. ```json { "response": { "licenses": [ { "license_id": "497", "product_id": "31", "variation_id": "0", "license_key": "204E-6914-EA60-185E", "image_license_key": null, "license_status": "sold", "owner_first_name": "Test", "owner_last_name": "Test", "owner_email_address": "contact@example.com", "activation_date": null, "creation_date": "2021-04-23", "expiration_date": "2021-05-23", "valid": "30", "order_id": "270", "sold_date": "2021-04-23", "product_name": "Product name", "variation_name": "Variation name", "delivery_limit": "0", "remaining_delivery_times": "0", "activation_limit": "1", "remaining_activations": "1", "device_ids": [ "domain.ltd", "domain2.ltd" ], "license_key_meta": [ { "id": "15", "meta_key": "example_key_1", "meta_value": "example value 1" }, { "id": "16", "meta_key": "example_key_2", "meta_value": "example value 2" } ] }, { "license_id": "496", "product_id": "31", "variation_id": "0", "license_key": "812A-434E-8805-F24F", "image_license_key": null, "license_status": "sold", "owner_first_name": "Test", "owner_last_name": "Test", "owner_email_address": "contact@example.com", "activation_date": null, "creation_date": "2021-04-23", "expiration_date": "2021-05-23", "valid": "30", "order_id": "270", "sold_date": "2021-04-23", "product_name": "Product name", "variation_name": "Variation name", "delivery_limit": "0", "remaining_delivery_times": "0", "activation_limit": "1", "remaining_activations": "1", "device_ids": [], "license_key_meta": [] }, { "license_id": "495", "product_id": "31", "variation_id": "0", "license_key": "2B9D-1F8A-A36B-582D", "image_license_key": null, "license_status": "sold", "owner_first_name": "Test", "owner_last_name": "Test", "owner_email_address": "contact@example.com", "activation_date": null, "creation_date": "2021-04-23", "expiration_date": "2021-05-23", "valid": "30", "order_id": "270", "sold_date": "2021-04-23", "product_name": "Product name", "variation_name": "Variation name", "delivery_limit": "0", "remaining_delivery_times": "0", "activation_limit": "1", "remaining_activations": "1", "device_ids": [], "license_key_meta": [] } ], "api_timestamp": 'current timestamp' }, "signature": "Signature or OpenSSL error" } ``` -------------------------------- ### Python API Request Example Source: https://docs.scodeware.com/resource/woocommerce-license-manager-api-version-2-api-implementation-example-in-python This Python code snippet demonstrates how to send an API request to the SCODEWARE server and process the JSON response. It utilizes the 'requests' library for making the HTTP POST request and the 'json' library for parsing the response. Ensure you have the 'requests' library installed. ```python import requests import json url = 'https://demo.firassaidi.com/wc-license-manager/' params = { 'fslm_v2_api_request': 'verify', 'fslm_api_key': '0A9Q5OXT13in3LGjM9F3', 'license_key': 'PDN3NDD5RHX' } x = requests.post(url, data = params) # Parse JSON response = json.loads(x.text) print(response) ``` -------------------------------- ### Get Product API Meta Request Example (PHP) Source: https://docs.scodeware.com/resource/woocommerce-license-manager-api-version-2-get-product-api-meta This PHP code snippet demonstrates how to construct and send a POST request to the SCODEWARE API to retrieve product metadata. It requires the WordPress website URL, API key, and product ID. The output is the raw result from the API. ```php // The post url is your WordPress website URL where the plugin is installed // If the your WordPress installation is in a sub-folder the URL to that sub-folder // should be used instead. Example: https://domain.ltd/my-sub-folder $post_url = 'https://domain.ltd/'; $parameters = array( // The API command // The fslm_v2_api_request parameter takes one of the following values // verify, activate, deactivate, details, extra_data 'fslm_v2_api_request' => 'extra_data', // Your API Key // You can set your API key in the page // License Manager > Settings > API 'fslm_api_key' => '0A9Q5OXT13in3LGjM9F3W', // WooCommerce Product ID 'product_id' => '123', ); //url-ify the data for the POST $fields_string = ""; foreach($parameters as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } rtrim($fields_string, '&'); // Open connection $ch = curl_init(); // Set the url, number of POST vars, POST data curl_setopt($ch, CURLOPT_URL, $post_url); curl_setopt($ch, CURLOPT_POST, count($parameters)); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Execute post $result = curl_exec($ch); cost_close($ch); // Display the request result echo $result; ``` -------------------------------- ### SCODEWARE API Response Examples Source: https://docs.scodeware.com/resource/woocommerce-license-manager-api-version-3-update-license-key This section provides examples of various responses from the SCODEWARE API when updating a license key. It includes successful responses, as well as error responses for common issues like invalid license keys, product IDs, variation IDs, order IDs, and insufficient user permissions. These examples help in understanding and handling API feedback. ```json { "response": { "result": "error", "code": "100", "message": "Invalid license key", "api_timestamp": 'current timestamp' }, "signature": "Signature or OpenSSL error" } ``` ```json { "response": { "result": "success", "code": "950", "message": "License key updated", "api_timestamp": 'current timestamp' }, "signature": "Signature or OpenSSL error" } ``` ```json { "response": { "result": "error", "code": "960", "message": "Invalid product ID", "api_timestamp": 'current timestamp' }, "signature": "Signature or OpenSSL error" } ``` ```json { "response": { "result": "error", "code": "961", "message": "Invalid variation ID", "api_timestamp": 'current timestamp' }, "signature": "Signature or OpenSSL error" } ``` ```json { "response": { "result": "error", "code": "980", "message": "Invalid order ID", "api_timestamp": 'current timestamp' }, "signature": "Signature or OpenSSL error" } ``` ```json { "response": { "result": "error", "code": "981", "message": "The order doesn't have an item with the given product ID", "api_timestamp": 'current timestamp' }, "signature": "Signature or OpenSSL error" } ``` ```json { "response": { "result": "error", "code": "982", "message": "The order doesn't have an item with the given variation ID", "api_timestamp": 'current timestamp' }, "signature": "Signature or OpenSSL error" } ``` ```json { "response": { "result": "error", "code": "900", "message": "The authenticated user doesn't own this license key", "api_timestamp": 'current timestamp' }, "signature": "Signature or OpenSSL error" } ``` -------------------------------- ### API Request to Get License Key Details (PHP) Source: https://docs.scodeware.com/resource/woocommerce-license-manager-api-version-2-get-license-key-details This PHP code snippet demonstrates how to make an API request to retrieve details for a given license key. It constructs the necessary POST parameters, including the API key, license key, and optional device ID, and uses cURL to send the request to the specified WordPress website URL. The result of the API call is then echoed. ```php // The post url is your WordPress website URL where the plugin is installed // If the your WordPress installation is in a sub-folder the URL to that sub-folder // should be used instead. Example: https://domain.ltd/my-sub-folder $post_url = 'https://domain.ltd/'; $parameters = array( // The API command // The fslm_v2_api_request parameter takes one of the following values // verify, activate, deactivate, details, extra_data 'fslm_v2_api_request' => 'details', // Your API Key // You can set your API key in the page // License Manager > Settings > API 'fslm_api_key' => '0A9Q5OXT13in3LGjM9F3W', // The License Key 'license_key' => 'FFFF-FFFF-FFFF-FFFF', // The device ID // The Device ID is optional, but if it is used and the license keys was activated with it // it becomes required, a license key activated with a Device ID can't be deactivated // without it and can't be activated again without it. // The device ID can be anything you want, its role is to identify the "Device", // "Machine" or "Domain" where the license was activated. 'device_id' => 'userdomain.ltd' ); //url-ify the data for the POST $fields_string = ""; foreach($parameters as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } rtrim($fields_string, '&'); // Open connection $ch = curl_init(); // Set the url, number of POST vars, POST data curl_setopt($ch, CURLOPT_URL, $post_url); curl_setopt($ch, CURLOPT_POST, count($parameters)); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Execute post $result = curl_exec($ch); cost($ch); // Display the request result echo $result; ``` -------------------------------- ### Get Available License Keys Source: https://docs.scodeware.com/resource/get-available-license-keys This endpoint allows you to retrieve a list of available license keys for a given product. You can specify the number of keys to retrieve and the status to assign them after retrieval. ```APIDOC ## POST /wp-json/wclm/v3/get-available-license-keys ### Description Retrieves a specified number of available license keys for a given product ID and variation ID. The status of the retrieved keys can be updated. ### Method POST ### Endpoint {{domain}}/wp-json/wclm/v3/get-available-license-keys ### Parameters #### Query Parameters - **count** (integer) - Optional - The number of license keys to return. - **product_id** (integer) - Required - The ID of the product. - **variation_id** (integer) - Optional - The ID of the product variation. Set to 0 if the product is not a variable product. - **status_after_retrieve** (string) - Optional - The new status assigned to the retrieved license keys (e.g., 'unregistered'). ### Request Example ```json { "count": "5", "product_id": 352, "variation_id": 0, "status_after_retrieve": "unregistered" } ``` ### Response #### Success Response (200) - **license_keys** (array) - A list of available license keys. - **status** (string) - The status of the operation. #### Response Example ```json { "license_keys": [ "KEY123-ABCDEF-GHIJKL-MNOPQR", "KEY456-STUVWX-YZABCD-EFGHIJ" ], "status": "success" } ``` ``` -------------------------------- ### Get License Details Source: https://docs.scodeware.com/resource/woocommerce-license-manager-api-version-3-uses-jwt-or-basic-auth Fetches comprehensive details about a specific license key, including activation data, associated product, and expiration. ```APIDOC ## Get License Details ### Description Fetches detailed information about a specific license key. ### Method GET ### Endpoint /licenses/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the license key to retrieve details for. ### Response #### Success Response (200) - **id** (integer) - The unique identifier for the license. - **key** (string) - The license key string. - **product_id** (integer) - The ID of the product associated with the license. - **status** (string) - The current status of the license. - **activations** (array) - A list of activations for this license. - **domain** (string) - The activated domain. - **activated_at** (string) - Timestamp of activation. - **expires_at** (string) - Timestamp of expiration (if applicable). #### Response Example ```json { "id": 1, "key": "LIC-ABC-123", "product_id": 10, "status": "active", "activations": [ { "domain": "example.com", "activated_at": "2023-10-27T10:00:00Z" } ], "expires_at": null } ``` ``` -------------------------------- ### Get License Key Details and Product API Meta API Request (PHP) Source: https://docs.scodeware.com/resource/woocommerce-license-manager-api-version-2-get-license-key-details-and-product-api-meta This PHP code snippet demonstrates how to send a POST request to a WordPress website to retrieve license key details and product API meta. It utilizes the cURL library to make the HTTP request and requires the WordPress website URL, API key, license key, and optionally a device ID. ```php // The post url is your WordPress website URL where the plugin is installed // If the your WordPress installation is in a sub-folder the URL to that sub-folder // should be used instead. Example: https://domain.ltd/my-sub-folder $post_url = 'https://domain.ltd/'; $parameters = array( // The API command // The fslm_v2_api_request parameter takes one of the following values // verify, activate, deactivate, details, extra_data 'fslm_v2_api_request' => 'license_details_with_product_data', // Your API Key // You can set your API key in the page // License Manager > Settings > API 'fslm_api_key' => '0A9Q5OXT13in3LGjM9F3W', // The License Key 'license_key' => 'FFFF-FFFF-FFFF-FFFF', // The device ID // The Device ID is optional, but if it is used and the license keys was activated with it // it becomes required, a license key activated with a Device ID can't be deactivated // without it and can't be activated again without it. // The device ID can be anything you want, its role is to identify the "Device", // "Machine" or "Domain" where the license was activated. 'device_id' => 'userdomain.ltd' ); //url-ify the data for the POST $fields_string = ""; foreach($parameters as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } rtrim($fields_string, '&'); // Open connection $ch = curl_init(); // Set the url, number of POST vars, POST data curl_setopt($ch, CURLOPT_URL, $post_url); curl_setopt($ch, CURLOPT_POST, count($parameters)); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Execute post $result = curl_exec($ch); cost $ch; // Display the request result echo $result; ``` -------------------------------- ### Activate License Key Source: https://docs.scodeware.com/resource/woocommerce-license-manager-api-version-3-uses-jwt-or-basic-auth Activates a given license key, typically associating it with a specific domain or installation. This is a crucial step for enabling product functionality. ```APIDOC ## Activate License Key ### Description Activates a specified license key. ### Method POST ### Endpoint /licenses/{id}/activate ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the license key to activate. #### Request Body - **domain** (string) - Required - The domain or URL where the license is being activated. ### Request Example ```json { "domain": "example.com" } ``` ### Response #### Success Response (200) - **message** (string) - A success message indicating activation. - **license_id** (integer) - The ID of the activated license. - **domain** (string) - The activated domain. #### Response Example ```json { "message": "License activated successfully.", "license_id": 1, "domain": "example.com" } ``` ``` -------------------------------- ### Scodeware API: Fetch Details (C#) Source: https://docs.scodeware.com/resource/woocommerce-license-manager-api-version-2-api-implementation-example-in-c This function makes a POST request to the Scodeware API to retrieve details. It uses `HttpClient` and `FormUrlEncodedContent` to send the request with specific parameters like API key and license key. The response is returned as a string. ```csharp private static async Task Details() { var values = new Dictionary { {"fslm_v2_api_request", "details"}, // The action {"fslm_api_key", "0A9Q5OXT13in3LGjM9F3"}, // The API key {"license_key", "PDN3NDD5RHX"} // The License Key }; var content = new FormUrlEncodedContent(values); var response = await Client.PostAsync(PostUrl, content); var responseString = await response.Content.ReadAsStringAsync(); // The variable responseString contains the query result return responseString; } ``` -------------------------------- ### License Manager API Endpoints Source: https://docs.scodeware.com/resource/woocommerce-license-manager-api-version-2-api-implementation-example-in-c This section details the various API endpoints for managing license keys, including activation, deactivation, verification, and retrieving details. ```APIDOC ## POST /wc-license-manager/ ### Description This API endpoint is used to manage license keys. It supports actions such as activating, deactivating, verifying, and retrieving details about a license. ### Method POST ### Endpoint https://demo.firassaidi.com/wc-license-manager/ ### Parameters #### Query Parameters - **fslm_v2_api_request** (string) - Required - The action to perform (e.g., "activate", "deactivate", "verify", "details", "extra_data"). - **fslm_api_key** (string) - Required - Your unique API key. - **license_key** (string) - Required - The license key to manage. - **device_id** (string) - Optional - The device identifier, used for activation and deactivation. ### Request Example ```json { "fslm_v2_api_request": "activate", "fslm_api_key": "YOUR_API_KEY", "license_key": "YOUR_LICENSE_KEY", "device_id": "your_domain.com" } ``` ### Response #### Success Response (200) - **result** (string) - Indicates the success or failure of the operation. - **code** (string) - A status code representing the result. - **message** (string) - A human-readable message describing the outcome. #### Response Example ```json { "result": "success", "code": "200", "message": "License activated successfully." } ``` ### Error Handling - **400 Bad Request**: Invalid or missing parameters. - **401 Unauthorized**: Invalid API key or license key. - **403 Forbidden**: Action not permitted for the given license. - **500 Internal Server Error**: Server-side error. ``` -------------------------------- ### Scodeware API: Fetch Extra Data (C#) Source: https://docs.scodeware.com/resource/woocommerce-license-manager-api-version-2-api-implementation-example-in-c This function retrieves additional data from the Scodeware API using a POST request. It includes parameters for the API request type ('ExtraData'), API key, and a product ID. The result is returned as a string. ```csharp private static async Task ExtraData() { var values = new Dictionary { {"fslm_v2_api_request", "ExtraData"}, // The action {"fslm_api_key", "0A9Q5OXT13in3LGjM9F3"}, // The API key {"product_id", "98"} // product ID }; var content = new FormUrlEncodedContent(values); var response = await Client.PostAsync(PostUrl, content); var responseString = await response.Content.ReadAsStringAsync(); // The variable responseString contains the query result return responseString; } ``` -------------------------------- ### Product ID Error Response Source: https://docs.scodeware.com/resource/get-available-license-keys This snippet shows an example of an API response when a Product ID is required but not provided. ```APIDOC ## Product ID Error Response ### Description This endpoint returns an error when the Product ID is missing from the request. ### Method POST ### Endpoint /websites/scodeware ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```json { "signature": "private key not set" } ``` ### Response #### Success Response (200) None #### Error Response (400) - **response** (object) - Contains details about the error. - **result** (string) - Indicates the outcome of the operation, "error" in this case. - **code** (string) - The error code, "990" signifies a missing Product ID. - **message** (string) - A human-readable message explaining the error: "Product ID is required". - **api_timestamp** (integer) - The timestamp of the API request. - **signature** (string) - The signature of the response, "private key not set" in this case. #### Response Example ```json { "response": { "result": "error", "code": "990", "message": "Product ID is required", "api_timestamp": 1750654378 }, "signature": "private key not set" } ``` ``` -------------------------------- ### Scodeware API: Check License Status (C#) Source: https://docs.scodeware.com/resource/woocommerce-license-manager-api-version-2-api-implementation-example-in-c This function checks the status of a license key by making a POST request to the Scodeware API. It sends the API request type ('license_status'), API key, and the license key. The API response is returned as a string. ```csharp private static async Task KeyStatus() { var values = new Dictionary { {"fslm_v2_api_request", "license_status"}, // The action {"fslm_api_key", "0A9Q5OXT13in3LGjM9F3"}, // The API key {"license_key", "PDN3NDD5RHX"} // The License Key }; var content = new FormUrlEncodedContent(values); var response = await Client.PostAsync(PostUrl, content); var responseString = await response.Content.ReadAsStringAsync(); // The variable responseString contains the query result return responseString; } ``` -------------------------------- ### C# License Management API Interaction Source: https://docs.scodeware.com/resource/woocommerce-license-manager-api-version-2-api-implementation-example-in-c This C# code demonstrates how to use the HttpClient to send POST requests to a license management API. It includes methods for activating, deactivating, verifying, and retrieving details of a license key. The code parses JSON responses and handles different API actions. ```csharp using System; using System.Collections.Generic; using System.Threading.Tasks; using System.Net.Http; using Newtonsoft.Json; namespace License_Manager_API { internal static class Program { private static readonly HttpClient Client = new HttpClient(); /** * The Post Url is your domain name, if your WordPress installation is in a sub folder the Post Url should include the sub folder. * Example: * https://domain.ltd/ * https://domain.ltd/sub-folder/ */ private const string PostUrl = "https://demo.firassaidi.com/wc-license-manager/"; public static void Main() { var result = Program.VerifyLicenseKey().Result; Console.WriteLine("Verify: " + result); // Parse JSON response dynamic parsedJson = JsonConvert.DeserializeObject(result); // Extracting the values form the parsedJson. string r = parsedJson.result; string code = parsedJson.code; string message = parsedJson.message; Console.WriteLine(r); Console.WriteLine(code); Console.WriteLine(message + "\n"); result = Program.KeyStatus().Result; Console.WriteLine("License Status: " + result + "\n"); result = Program.ActivateLicenseKey().Result; Console.WriteLine("Activate: " + result + "\n"); result = Program.KeyStatus().Result; Console.WriteLine("License Status: " + result + "\n"); result = Program.DeactivateLicenseKey().Result; Console.WriteLine("Deactivate: " + result + "\n"); result = Program.KeyStatus().Result; Console.WriteLine("License Status: " + result + "\n"); result = Program.DetailsLicenseKey().Result; Console.WriteLine("License Key Details: " + result + "\n"); result = Program.ExtraData().Result; Console.WriteLine("Extra Product Data: " + result + "\n"); result = Program.KeyStatus().Result; Console.WriteLine("License Status: " + result + "\n"); Console.ReadKey(); } private static async Task ActivateLicenseKey() { var values = new Dictionary { {"fslm_v2_api_request", "activate"}, // The action {"fslm_api_key", "0A9Q5OXT13in3LGjM9F3"}, // The API key {"license_key", "PDN3NDD5RHX"}, // The License Key {"device_id", "domain.ltd"} // The License Key }; var content = new FormUrlEncodedContent(values); var response = await Client.PostAsync(PostUrl, content); var responseString = await response.Content.ReadAsStringAsync(); // The variable responseString contains the query result return responseString; } private static async Task DeactivateLicenseKey() { var values = new Dictionary { {"fslm_v2_api_request", "deactivate"}, // The action {"fslm_api_key", "0A9Q5OXT13in3LGjM9F3"}, // The API key {"license_key", "PDN3NDD5RHX"}, // The License Key {"device_id", "domain.ltd"} // The License Key }; var content = new FormUrlEncodedContent(values); var response = await Client.PostAsync(PostUrl, content); var responseString = await response.Content.ReadAsStringAsync(); // The variable responseString contains the query result return responseString; } private static async Task VerifyLicenseKey() { var values = new Dictionary { {"fslm_v2_api_request", "verify"}, // The action {"fslm_api_key", "0A9Q5OXT13in3LGjM9F3"}, // The API key {"license_key", "PDN3NDD5RHX"} // The License Key }; var content = new FormUrlEncodedContent(values); var response = await Client.PostAsync(PostUrl, content); var responseString = await response.Content.ReadAsStringAsync(); // The variable responseString contains the query result return responseString; } private static async Task DetailsLicenseKey() { var values = new Dictionary { ``` -------------------------------- ### Force HTTPS in .htaccess for WordPress Source: https://docs.scodeware.com/article/how-to-get-a-free-ssl-certificate-for-your-wordpress-site This code snippet is added to the .htaccess file to redirect all HTTP traffic to HTTPS. It ensures that all visitors access your site securely. This is a common practice for enforcing SSL after installation. ```apache RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L] ``` -------------------------------- ### Get License Status using cURL Source: https://docs.scodeware.com/resource/woocommerce-license-manager-api-version-3-get-license-status This code snippet demonstrates how to call the SCODEWARE API to get the license status. It requires a domain, license key, and user token for authentication. The endpoint returns the license status directly from the database, without calculating expiration. ```php $curl = curl_init(); $endpoint = '{{domain}}/wp-json/wclm/v3/get-license-status'; $parameters = array( // License Key 'license_key' => 'FFFF-FFFF-FFFF-FFFF' ); curl_setopt_array($curl, array( CURLOPT_URL => $endpoint, CURLOPT_RETURNTRANSFER => true, CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => $parameters, CURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT'], CURLOPT_SSL_VERIFYPEER => false, CURLOPT_HTTPHEADER => array( // Authenticated user token 'Authorization: Bearer {{User Token}}' ) )); $response = curl_exec($curl); curl_close($curl); echo $response; ``` -------------------------------- ### Get License Status Source: https://docs.scodeware.com/resource/woocommerce-license-manager-api-version-3-get-license-status This endpoint returns the license status as-is in the database. It can also be used to access custom license statuses set via the API. ```APIDOC ## POST /wp-json/wclm/v3/get-license-status ### Description Retrieves the current license status from the database. This endpoint is useful for checking custom license statuses and is recommended to be used with meta keys for custom data. ### Method POST ### Endpoint `{{domain}}/wp-json/wclm/v3/get-license-status` ### Parameters #### Query Parameters - **license_key** (string) - Required - The license key to check the status for. #### Request Body This endpoint does not explicitly define a request body, but the `license_key` is typically sent as part of the POST data in the example. ### Request Example ``` { "license_key": "FFFF-FFFF-FFFF-FFFF" } ``` ### Response #### Success Response (200) - **response** (object) - Contains the license status details. - **license_status** (string) - The status of the license (e.g., "inactive"). - **api_timestamp** (string) - The timestamp of the API request. - **signature** (string) - Signature or OpenSSL error information. #### Error Response (e.g., 400, 403) - **response** (object) - Contains error details. - **result** (string) - Indicates an error occurred (e.g., "error"). - **code** (string) - The error code. - **message** (string) - A description of the error. - **api_timestamp** (string) - The timestamp of the API request. - **signature** (string) - Signature or OpenSSL error information. #### Response Example (Success) ```json { "response": { "license_status": "inactive", "api_timestamp": "current timestamp" }, "signature": "Signature or OpenSSL error" } ``` #### Response Example (Invalid License Key) ```json { "response": { "result": "error", "code": "100", "message": "Invalid license key", "api_timestamp": "current timestamp" }, "signature": "Signature or OpenSSL error" } ``` #### Response Example (User Not Owner) ```json { "response": { "result": "error", "code": "900", "message": "The authenticated user doesn't own this license key", "api_timestamp": "current timestamp" }, "signature": "Signature or OpenSSL error" } ``` #### Response Example (Forbidden) ```json { "code": "rest_forbidden", "message": "Sorry, you are not allowed to do that.", "data": { "status": 403 } } ``` ``` -------------------------------- ### Get License Details Source: https://docs.scodeware.com/resource/woocommerce-license-manager-api-version-3-get-license-details Retrieves the details of a specific license key. This endpoint allows you to fetch comprehensive information about a license, including its status, expiration, and associated product details. ```APIDOC ## POST /wp-json/wclm/v3/get-license-details ### Description Retrieves the details of a specific license key. This endpoint allows you to fetch comprehensive information about a license, including its status, expiration, and associated product details. ### Method POST ### Endpoint {{domain}}/wp-json/wclm/v3/get-license-details ### Parameters #### Query Parameters - **license_key** (string) - Required - The license key to retrieve details for. #### Request Body This endpoint does not explicitly define a request body in the provided documentation, but the example uses POST with parameters. ### Request Example ```bash curl -X POST \ '{{domain}}/wp-json/wclm/v3/get-license-details?license_key=FFFF-FFFF-FFFF-FFFF' \ -H 'Authorization: Bearer {{User Token}}' \ -H 'Content-Type: application/x-www-form-urlencoded' ``` ### Response #### Success Response (200) - **response** (object) - Contains the license details or an error message. - **result** (string) - Indicates 'success' or 'error'. - **code** (string) - An error code if applicable. - **message** (string) - A descriptive message for the response. - **api_timestamp** (string) - The timestamp of the API request. - **license_id** (string) - The unique identifier for the license. - **product_id** (string) - The unique identifier for the product. - **variation_id** (string) - The unique identifier for the product variation. - **license_key** (string) - The license key. - **image_license_key** (string|null) - Image license key if applicable. - **license_status** (string) - The current status of the license (e.g., 'inactive'). - **owner_first_name** (string) - The first name of the license owner. - **owner_last_name** (string) - The last name of the license owner. - **owner_email_address** (string) - The email address of the license owner. - **activation_date** (string) - The date the license was activated. - **creation_date** (string) - The date the license was created. - **expiration_date** (string) - The date the license expires. - **valid** (string) - The validity period of the license in days. - **order_id** (string) - The order ID associated with the license. - **product_name** (string) - The name of the product. - **variation_name** (string) - The name of the product variation. - **sold_date** (string) - The date the license was sold. - **delivery_limit** (string) - The limit for license delivery. - **remaining_delivery_times** (string) - The remaining delivery times for the license. - **activation_limit** (string) - The limit for license activation. - **remaining_activations** (string) - The remaining activations for the license. - **device_ids** (array) - A list of device IDs associated with the license. - **license_key_meta** (array) - An array of meta key-value pairs for the license. - **id** (string) - The meta ID. - **meta_key** (string) - The meta key. - **meta_value** (string) - The meta value. - **signature** (string) - A signature for the response, used for verification. #### Error Responses - **403 Forbidden**: Returned if the authenticated user does not have permission to access the license details. - **code** (string) - 'rest_forbidden' - **message** (string) - 'Sorry, you are not allowed to do that.' - **data.status** (integer) - 403 - **Invalid License Key**: Returned if the provided license key is invalid. - **response.result**: 'error' - **response.code**: '100' - **response.message**: 'Invalid license key' - **Unauthorized Access**: Returned if the authenticated user does not own the license key. - **response.result**: 'error' - **response.code**: '900' - **response.message**: 'The authenticated user doesn\'t own this license key' #### Response Example (Success) ```json { "response": { "license_id": "453", "product_id": "236", "variation_id": "0", "license_key": "FFFF-FFFF-FFFF-FFFF", "image_license_key": null, "license_status": "inactive", "owner_first_name": "Test", "owner_last_name": "Test", "owner_email_address": "contact@domain.ltd", "activation_date": "2021-04-13", "creation_date": "2021-04-13", "expiration_date": "2022-04-12", "valid": "365", "order_id": "259", "product_name": "Product name", "variation_name": "Variation name", "sold_date": "2021-04-12", "delivery_limit": "1", "remaining_delivery_times": "1", "activation_limit": "3", "remaining_activations": "3", "device_ids": [ "domain.ltd", "domain2.ltd" ], "license_key_meta": [ { "id": "15", "meta_key": "example_key_1", "meta_value": "example value 1" }, { "id": "16", "meta_key": "example_key_2", "meta_value": "example value 2" } ], "api_timestamp": 'current timestamp' }, "signature": "Signature or OpenSSL error" } ``` #### Response Example (Error - Invalid License Key) ```json { "response": { "result": "error", "code": "100", "message": "Invalid license key", "api_timestamp": 'current timestamp' }, "signature": "Signature or OpenSSL error" } ``` #### Response Example (Error - Unauthorized Access) ```json { "response": { "result": "error", "code": "900", "message": "The authenticated user doesn\'t own this license key", "api_timestamp": 'current timestamp' }, "signature": "Signature or OpenSSL error" } ``` #### Response Example (Error - Forbidden) ```json { "code": "rest_forbidden", "message": "Sorry, you are not allowed to do that.", "data": { "status": 403 } } ``` ```