[PHP] Can't POST to People Endpoint with Curl

[PHP] Can't POST to People Endpoint with Curl

Hi All,

I'm trying to create a timesheet via an API call.
Even though I am not passing an AuthToken and parameters, the error should say 'Provided authentication token is invalid', but the error I get is:
{"response":{"message":"Error occurred","uri":"/api/timetracker/createtimesheet","errors":{"code":7206,"message":"This URL can be invoked via POST method only"},"status":1}}
 
  1.         $url = "http://people.zoho.com/people/api/timetracker/createtimesheet";
  2.         $ch = curl_init();
  3. curl_setopt($ch, CURLOPT_URL, $url);
  4. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  5. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  6. curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  7. curl_setopt($ch, CURLOPT_POST, 1);
  8. curl_setopt($ch, CURLOPT_POSTFIELDS, array());
  9. $result = curl_exec($ch);
  10. curl_close($ch);
  11. echo $result;
  12. return $result;