Client portal

Having a hard time using license API. Need examples.

 June 19, 2014     0 Comments

Adding a reseller license via the new licensedefender API has just become very easy.  

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
http://www.clientexec.com/documentation/api/licensedefender.php

Adding a new license is this easy

require_once 'RestRequest.inc.php';
$url = "http://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 = "http://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.