[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;

    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation
                                          • Topic Participants

                                          • Ari

                                              • Sticky Posts

                                              • Meet the Zoho People experts in your city!

                                                Dear users,   We are delighted to invite you to the Zoho People's user community meetup. We are stoked to visit our users in their cities and help them with all things Zoho People.   Join us for a day of insightful Zoho sessions, interactions with other


                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now