Having a hard time using license API. Need examples.

 April 28, 2020     0 Comments

PHP example

The first thing you will need is a REST request class. There are a few out there but due to the amazing job of explaining his implementation we would recommend the following post which includes a downloadable class. Download the RestRequest class and continue reading below. (http://www.gen-x-design.com/archives/making-restful-requests-in-php/)

API Documentation

There are three major functions available to you via the API

https://www.clientexec.com/api/resource/reseller

Adding a new license is this easy


require_once 'RestRequest.inc.php';
$url = "https://www.licensedefender.com/api/v1/license/";
$request = new RestRequest($url, 'POST');
$request->buildPostBody(array('domain'=>'testing100.com'));
$request->setUsername('yourresellerlogin');
$request->setPassword('yourresellerpassword');
$request->execute();

Removing a license


require_once 'RestRequest.inc.php';
$url = "https://www.licensedefender.com/api/v1/license/testing100.com";
$request = new RestRequest($url, 'DELETE');        
$request->setUsername('yourresellerlogin');
$request->setPassword('yourresellerpassword');
$request->execute();

How helpful was this article to you?

Posting has been disabled.