amirreza mousavi Posted May 31, 2019 Share Posted May 31, 2019 Hi I try to get my client contacts from whmcs database by this API but that does not return any contacts. what can I do to resolve this problem? 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Staff WHMCS Peter Posted June 3, 2019 WHMCS Staff Share Posted June 3, 2019 Hi @amirreza mousavi, Without providing your sensitive details, such as API Identifiers or Usernames/Passwords, could you provide me with a copy of the code you're using? I can advise if this is the best way to interact with the WHMCS API. 0 Quote Link to comment Share on other sites More sharing options...
amirreza mousavi Posted June 3, 2019 Author Share Posted June 3, 2019 my account user id in the database is 18 but when I run this code that returns nothing. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://test.com/portal/includes/api.php'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query( array( 'action' => 'GetContacts', // See https://developers.whmcs.com/api/authentication 'username' => 'apiusername', 'password' => 'apiPassword', 'userid' => '18', 'responsetype' => 'json', ) ) ); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($ch); var_dump ($response); curl_close($ch); output: string(71) "{"result":"success","totalresults":"0","startnumber":0,"numreturned":0}" 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.