Jump to content

How to use API ?

Recommended Posts



I need to customize order page for my site. Can Some one give me code for order and client login.


My developer is on leave. I can not wait until he returns from leave..


I tried to use below code for login but its not working




$url = "http://www.domain.com/whmcs/includes/api.php"; # URL to WHMCS API file
$username = "Admin"; # Admin username goes here
$password = "whmcs_password"; # Admin password goes here

$command = "validatelogin";
$postfields["action"] = "validatelogin";
$postfields["email"] = "xyz@plantest.com";
$postfields["password2"] = "Zaq12345";

$data = explode(";",$data);
foreach ($data AS $temp) {
$temp = explode("=",$temp);
$results[$temp[0]] = $temp[1];

if ($results["result"]=="success") {
# Result was OK!
} else {
# An error occured
echo "The following error occured: ".$results["message"];


Sorry I don't have much knowledge about php , Am I using correct code ?

Link to comment
Share on other sites

Hi tech,


its probably a good idea to wait for your developer, i understand the need to get things done now, but this in turn could lead to bigger problems for not only your developer but your entire venture.



$command = "validatelogin";
$postfields["action"] = "validatelogin";
$postfields["email"] = "xyz@plantest.com";
$postfields["password2"] = "Zaq12345";




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.

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