FAQ - HelpDesk - Client Api

HelpDesk - Client Api

4061


HelpDesk has a great client api integrated. You can integrate this into your own website where your client create a user or change their data or delete their user profile. You need curl installed on your server and pass the vars to your HelpDesk installation, it will then create, update or delete a user from your HelpDesk client database.

$CD_URL = "url_where_helpdesk"; // url to the helpdesk installation
$CD_API_KEY = ""; // can be found in your operator panel - settings
$CD_SID_KEY = ""; // can be found in your operator panel - settings
$CD_ACTION = "new"; // (new,update,delete)
$CD_NAME = ""; // name from client
$CD_EMAIL = ""; // valid email address from client
$CD_PROJECTIDS = "1"; // (single id or multiple id's (1,2,3))
$CD_CHATACCESS = ""; // (0 for no access, 1 for access)
$CD_TICKETACCESS = ""; // (0 for no access, 1 for access)
$CD_FAQACCESS = ""; // (0 for no access, 1 for access)
$CD_VALIDTILL = ""; // (0000-00-00 / Year-Month-Day)
	
$CD_STR = urlencode("sid=".$CD_SID_KEY."&action=".$CD_ACTION."&name=".$CD_NAME."&email=".$CD_EMAIL."&pid=".$CD_PROJECTIDS."&cac=".$CD_CHATACCESS."&tac=".$CD_TICKETACCESS."&fac=".$CD_FAQACCESS."&valid=".$CD_VALIDTILL);
	
$CD_STR = (trim(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $CD_API_KEY, $CD_STR, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));
	
$CD_CURL = curl_init();
	
// set URL and other appropriate options
curl_setopt($CD_CURL, CURLOPT_URL, $CD_URL.'/index.php?p=api&sp='.bin2hex($CD_STR));
curl_setopt($CD_CURL, CURLOPT_SSL_VERIFYPEER,  false);
curl_setopt($CD_CURL, CURLOPT_HEADER, 0);
	
// grab URL and pass it to the browser
curl_exec($CD_CURL);
	
// close cURL resource, and free up system resources
curl_close($CD_CURL);