Example Expire Private API Request

// 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:
    // expire, (more option will be added in the future)
    'fslm_v2_api_request' => 'expire',
 
    // Your Private API Key
    // You can set your Private API key in the page
    // License Manager > Settings > API
    'fslm_private_api_key' => '3a5088d8-2aa0-41d2-b151-79eaf845f3ef',
 
    // The License Key
    'license_key' => 'FFFF-FFFF-FFFF-FFFF',
);
 
 
//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);
curl_close($ch);
 
// Display the request result
echo $result;

Responses:

Success

{
    "result": "success",
    "code": "800",
    "message": "License status updated"
}

Invalid license key

{
    "result": "error",
    "code": "100",
    "message": "Invalid license key"
}

Invalid API key

{
    "result": "error",
    "code": "200",
    "message": "Invalid API key"
}

Was this article helpful to you? Yes No