$post = [
'data' => [
[
"Account_Name" => "$fname",
"Date_Of_Birth" => "$dob",
"Gender" => "$gender",
"Email" => "$email",
"Mobile_No" => "$phone",
"Alternate_number" => "$alt_no",
"Type_of_coaching" => "$type_of_coatching",
"Branch" => "$branch_name",
"Batch" => "$batch_name",
"Level" => "$level_name",
"Date_Of_Admission" => "$doa",
"Country" => "$country",
"State" => "$state",
"Zip_Code" => "$pin",
"FIDE_rating" => "$fide",
"Referance_of_VCA" => "$ref_name",
"Address" => "$addr"
]
],
'trigger' => [
"approval",
"workflow",
"blueprint"
]
];
try{
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "
https://www.zohoapis.in/crm/v2/Accounts"); curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode( $post ));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 120);
curl_setopt($curl, CURLOPT_TIMEOUT, 120);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Authorization: Zoho-oauthtoken ' . $newaccess_token, 'Content-Type: application/x-www-form-urlencoded' ));
$json_response = curl_exec($curl);
$json_response = json_decode($json_response);
var_dump( $json_response );
curl_close($curl);
} catch (Exception $ex) {
curl_close($curl);
}