Zoho API uploadFile to Cases

Zoho API uploadFile to Cases

Hi,

I need to be able to upload a file to a case but keep getting 4600.

The following is the code.

Any help would be greatly appreciated.

  1. <?php
  2. $recordId="my-record-id";
  3. $ch=curl_init();
  4. curl_setopt($ch,CURLOPT_HEADER,0);
  5. curl_setopt($ch,CURLOPT_VERBOSE,0);
  6. curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
  7. curl_setopt($ch,CURLOPT_URL,"https://crm.zoho.com/crm/private/xml/Cases/uploadFile?authtoken=<my-token>&scope=crmapi");
  8. curl_setopt($ch,CURLOPT_POST,true);
  9. $post=array("id"=>$recordId,"content"=>"/Users/john/files/filename.jpg");
  10. curl_setopt($ch,CURLOPT_POSTFIELDS,$post);
  11. $response=curl_exec($ch);
  12. echo $response;
  13. ?>