I'm having an issue with coql. I keep getting an invalid_request returned to me, but I feel like I'm doing everything right. So I hope getting more eyes on it could help me along.
Scope:
- scope=ZohoCRM.modules.leads.ALL,ZohoCRM.coql.READ
Php code:
- $api_domain = "https://www.zohoapis.com";
- $access_token = get_option('access_token');
- $url = $api_domain . "/crm/v2/coql";
- $dataArray["select_query"] = "select Last_Name from Leads";
- $data = json_encode($dataArray);
- $curl = curl_init();
- curl_setopt_array($curl, array(
- CURLOPT_RETURNTRANSFER => 1,
- CURLOPT_URL => $url,
- CURLOPT_POST => 1,
- CURLOPT_HTTPHEADER => array(
- "Authorization: Zoho-oauthtoken ".$access_token,
- "Content-Type: application/json",
- ),
- CURLOPT_POSTFIELDS => $data
- ));
- $resp = curl_exec($curl);
- curl_close($curl);
Response:
stdClass Object
(
[code] => INVALID_REQUEST
[details] => stdClass Object
(
)
[message] => unable to process your request. please verify whether you have entered proper method name, parameter and parameter values.
[status] => error
)