<?php
function insert_leads(){
$accesstoken = '1000.eb4d9947827e42da8f29b8d24d650259.734213ba7c517*****************';
$post_data=[
'data'=>[
[
'Company' =>'Mildain',
'Last_Name' =>'Pandey',
'First_Name' =>'Saroj',
'State' =>'Delhi',
'Phone' =>'8377972697',
'Description' =>'This is test api',
]
],
'trigger' =>[
"approval",
"workflow",
"blueprint"
]
];
$ch = curl_init();
curl_setopt($ch,CURLOPT_POST, 1); //0 for a get request
curl_setopt($ch,CURLOPT_POSTFIELDS,json_encode($post_data));
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($ch,CURLOPT_HTTPHEADER,array('Authorization: Zoho-oauthtoken'.$accesstoken, 'Content-Type: application/x-www-form-urlencoded'));
$response = curl_exec($ch);
$response = json_decode($response);
var_dump($response);
// return $response;
// echo '<pre>';
// print_r($response);
}
insert_leads();
?>