I'm not getting any response on API
I have this code
- private $token = '1234567890abcdefg';
- public $responseType = 'xml';
-
- public function getSearchRecordsByPDC($searchValue,$searchColumn='email')
- {
- $url = "https://crm.zoho.com/crm/private/".$this->responseType."/Leads/getSearchRecordsByPDC?newFormat=1&authtoken=".$this->token."&scope=crmapi&selectColumns=Leads(First Name,Lead Source,Phone,Mobile,Website,Lead Status,Description,Last Name,Website,Email,Lead Owner)&searchColumn=$searchColumn&searchValue=$searchValue";
-
- $result = $this->curlRequest($url);
- return $result;
- }
- public function curlRequest($url)
- {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- $output = curl_exec($ch);
- curl_close($ch);
- return $output;
- }
- $data = $zoho->getSearchRecordsByPDC('my_email@gmail.com');
- print_r($data);
I just simplified the code to not appear it to be very long. When running this code. I am not getting any response, even an error message or whatsoever, like I am getting a blank response, no xml response or whatever. But when ever I try to copy and paste the $url variable output into my web browser, I am getting response, and those response are valid.
What's wrong with this? Your help will be greatly appreciated! Thanks!