sudohunter Posted November 2, 2020 Share Posted November 2, 2020 /run $postfields = array( 'username' => '******', 'password' => '******', 'action' => 'GetClients', 'responsetype' => 'json', ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://******/includes/api.php'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields)); $response = curl_exec($ch); if (curl_error($ch)) { die('Unable to connect: ' . curl_errno($ch) . ' - ' . curl_error($ch)); } curl_close($ch); $jsonData = json_decode($response, true); var_dump($jsonData); result : array(2) { ["result"]=> string(5) "error" ["message"]=> string(26) "Invalid IP *****" } 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted November 16, 2020 Share Posted November 16, 2020 You need to add the IP your connecting from to the API allow list in General settings -> security -> API IP Access Restriction 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.