coql - invalid_request

coql - invalid_request

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:
  1. scope=ZohoCRM.modules.leads.ALL,ZohoCRM.coql.READ
Php code:
  1. $api_domain = "https://www.zohoapis.com";
  2. $access_token = get_option('access_token');
  3. $url = $api_domain . "/crm/v2/coql";
  4. $dataArray["select_query"] = "select Last_Name from Leads";
  5. $data = json_encode($dataArray);
  6. $curl = curl_init();
  7. curl_setopt_array($curl, array(
  8. CURLOPT_RETURNTRANSFER => 1,
  9. CURLOPT_URL => $url,
  10. CURLOPT_POST => 1,
  11. CURLOPT_HTTPHEADER => array(
  12. "Authorization: Zoho-oauthtoken ".$access_token,
  13. "Content-Type: application/json",
  14. ),
  15. CURLOPT_POSTFIELDS => $data
  16. ));
  17. $resp = curl_exec($curl);
  18. curl_close($curl);
Response:
  1. 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
    )