kenby Posted August 31, 2008 Share Posted August 31, 2008 Hey folk, anybody know how to use the WHMCS's API kit with ASP.net? I couldn't add the http://domain.com/whmcs/includes/api.php to my web references in Visual Studio .. as I saw it's only possible to use this API with PHP programming ..! .. any kinda help would be appreciated! 0 Quote Link to comment Share on other sites More sharing options...
Shaun Posted September 1, 2008 Share Posted September 1, 2008 this is beacause its two totally different langauages. What you need to do is Post data the the PHP api handler (see http://wiki.whmcs.com/API:Example_Usage) This Asp Alliance article has more info about how to post with asp. You then enter the address to post to as the api url (http://www.mywhcms.com/whmcs/includes/api.php) Hope this helps. 0 Quote Link to comment Share on other sites More sharing options...
bonave Posted October 17, 2011 Share Posted October 17, 2011 ASP.NET Help and Tutorial http://asp.net-informations.com Bonav 0 Quote Link to comment Share on other sites More sharing options...
ZweTha Posted May 29, 2012 Share Posted May 29, 2012 Dear Shaun, Is there anyway to call WGNCS' PHP API from ASP.Net Application ? 0 Quote Link to comment Share on other sites More sharing options...
Peter M Dodge Posted May 29, 2012 Share Posted May 29, 2012 ...He just explained how to do that. You need to send the data to the API via HTTP_POST. 0 Quote Link to comment Share on other sites More sharing options...
ZweTha Posted May 29, 2012 Share Posted May 29, 2012 Thanks Peter M Dodge, But I have problem, because WHMCS sample code show like that 1 $url = "http://www.yourdomain.com/whmcs/includes/api.php"; # URL to WHMCS API file 2 $username = "Admin"; # Admin username goes here 3 $password = "demo"; # Admin password goes here 4 5 $postfields["username"] = $username; 6 $postfields["password"] = md5($password); 7 $postfields["action"] = "addinvoicepayment"; #action performed by the [[API:Functions]] 8 $postfields["invoiceid"] = "1"; 9 $postfields["transid"] = "TEST"; 10 $postfields["gateway"] = "mailin"; 11 12 $ch = curl_init(); 13 curl_setopt($ch, CURLOPT_URL, $url); 14 curl_setopt($ch, CURLOPT_POST, 1); 15 curl_setopt($ch, CURLOPT_TIMEOUT, 100); 16 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 17 curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); 18 $data = curl_exec($ch); 19 curl_close($ch); at line 12, that coad use curl_init() object, I think I can't access to the curl_init class from my .Net application. help me. 0 Quote Link to comment Share on other sites More sharing options...
ZweTha Posted May 29, 2012 Share Posted May 29, 2012 Yes, I can submit POST data to PHP page, but I don't know how to execute the functions from WHMCMS' API. I means, the example code using curl_init object from includes/api.php. But in ASP.Net can not use curl_init object. So, which page should I send my POST data?. Help me 0 Quote Link to comment Share on other sites More sharing options...
ZweTha Posted May 29, 2012 Share Posted May 29, 2012 Sorry i just worng typed. *WHMCS' API. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.