<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => ‘{domain}/api/add_lead_api’,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => ”,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => ‘POST’,
CURLOPT_POSTFIELDS =>'{“phone”:”0908123456″, “psid”:0, “photos”:””, “title”:”Ông”, “information”:”Gọi liền”, “company”:””, “fullname”:”Nguyen vo”, “utm_source”:”facebook”, “utm_campaign”:”ads”, “url”:””}’,
CURLOPT_HTTPHEADER => array(
‘Authorization: Bearer fc0f9284595f4242ba1a41f393a5cdf1ed3e2d24f4486174713c82e7a7512’,
‘Content-Type: application/json’
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var settings = {
“url”: “{domain}/api/add_lead_api”,
“method”: “POST”,
“timeout”: 0,
“headers”: {
“Authorization”: “Bearer fc0f9284595f4242ba1a41f393a5cdf1ed3e2d24f4486174713c82e7a711”,
“Content-Type”: “application/json”
},
“data”: JSON.stringify({
“phone”: “09086064271111”,
“psid”: 0,
“photos”: “”,
“title”: “Ông”,
“information”: “Gọi liền”,
“company”: “”,
“fullname”: “Nguyen vo”,
“utm_source”: “facebook”,
“utm_campaign”: “ads”,
“url”: “”
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});