I want to know, my Leads insertion is successful, but the following fields are not affected.
The "Created_By" and "Modified_By" are filled with the user information of the token giver
For the sake of the example, I only show the fields related to the issue. Normally, all other variables are here
$token = "************************";
$module = "Leads";
$Created_By = array("id"=> "35545*************", "name"=>"Steven Smith");
$Modified_By = array("id"=> "35545*************", "name"=>"Steven Smith");
$Last_Activity_Time = "2019-05-05T14:20:23+05:30";
$Modified_Time = "2019-05-05T14:20:23+05:30";
$Created_Time = "2019-05-05T14:20:23+05:30";
//Making the array with the passed data
$data_array=array( 'Lead_Source' => $Lead_Source,
'Company' => $Company,
'Annual_Revenue' => $Annual_Revenue,
'City' => $City,
'Country' => $Country,
'Created_By' => $Created_By,
'Created_Time' => $Created_Time,
'Description' => $Description,
'Email' => $Email,
'Email_Opt_Out' => $Email_Opt_Out,
'Fax' => $Fax,
'First_Name' => $First_Name,
'Industry' => $Industry,
'Last_Activity_Time' => $Last_Activity_Time,
'Last_Name' => $Last_Name,
'Record_Image' => $cFile,
'Owner' => $Owner,
'Lead_Status' => $Lead_Status,
'Mobile' => $Mobile,
'Modified_By' => $Modified_By,
'Modified_Time' => $Modified_Time,
'No_of_Employees' => $No_of_Employees,
'Phone' => $Phone,
'Prediction_Score' => $Prediction_Score,
'Rating' => $Rating,
'Secondary_Email' => $Secondary_Email,
'Skype_ID' => $Skype_ID,
'State' => $State,
'Street' => $Street,
'Designation' => $Designation,
'Twitter' => $Twitter,
'Website' => $Website,
'Zip_Code' => $Zip_Code
);
$obj =ZOHO_API::getInstance();
$obj->setRequestType("POST");
$obj->set_access_token($token);
$record_array=array($data_array);
$data = array('data' => $record_array, 'trigger' => array('workflow','approval','blueprint'));
$obj->setRequestBody($data);
$obj->fireRequest();
$response=$obj->getresponseJson();
return $this->SendResponse($response);