Jump to content

Using WHMCS API in asp.net programming


kenby

Recommended Posts

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.

Link to comment
Share on other sites

  • 3 years later...
  • 7 months later...

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. :|

Link to comment
Share on other sites

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 :?:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated