ZOHO CRM API Update Not Working As Intended

ZOHO CRM API Update Not Working As Intended

I have creates and delete working as they should but when I attempt to update a record using the API nothing happens. It gives me a success message but does not actually update the record. I am sure I am missing something simple. Any assistance you can provide would be greatly appreciated.

Here is the code I am using to do the update.

<?php

$curl = curl_init();

curl_setopt_array($curlarray(
  CURLOPT_URL => "https://www.zohoapis.com/crm/v2/Contacts/XXXXXXXXXXXXXXX",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS =>"{\r\n  \"data\": [\r\n    {\r\n            \"User_Test\": {\r\n                \"name\": \"XXXXXXXXXXX\",\r\n                \"id\": \"292XXXXXXXXXXXXXXXXX\"\r\n            }\r\n    }\r\n  ]\r\n}",
  CURLOPT_HTTPHEADER => array(
    "Authorization: Zoho-oauthtoken 1000.####################################",
    "Content-Type: application/json"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Here is the RAW request:

{
  "data": [
    {
            "User_Test": {
                "name""XXXXXXXXXXXXX",
                "id""292XXXXXXXXXXXXX"
            }
    }
  ]
}





      • Sticky Posts

      • How to Add Users to your Organization in ZohoMail?

        A better clarity so you can create other users to start using Zoho Mail. You can directly Add Users from the Control Panel to your Organization. You can invite users with the existing email address. If the person (user) already uses ZohoCRM, then you can import users from Zoho CRM. You can also import them using a .csv file. (if you are planning to add them in Bulk)  In this topic, We will be discussing on how to Add and Invite users only.  The Import options are self explanatory. ____________________________________________________________________________________________________________