יצירת לקוח
$curl = curl_init();curl_setopt_array($curl, array(
CURLOPT_URL => 'https://app.caspit.biz/api/v1/contacts/',
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 =>'{"ContactId":"5:2:668","ContactType":null,"Number":null,"BusinessName":"Jack Cohen","OsekMorshe":null,"Name":null,"Address1":"45 West St.","Address2":"Suite 6276","City":"Lousiville, KT","PostalCode":"72789","Country":null,"Phone":null,"Mobile":null,"Fax":null,"Email":null,"TrxCodeNumber":null,"TrxCode":null,"OpenBalance":null,"Balance":null,"BalanceInvoiceIska":null,"PriceListNum":null,"Comments1":"","Comments2":"","Comments3":"","InvoiceComment":"","BankAcctNumber":"","BankAcctBranch":"","BankAcctBankId":null,"ChargeVAT":null,"AffiliateId":null}
',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Caspit-Token: 6AEEFD6881E634BA11C8C00EC02C6F6E976799D9C450E2BE',
'Cookie: .Stackify.Rum=af3e4b14-6976-4983-8a69-5f38467a4a4e; ASP.NET_SessionId=uulynubikx4bnqrtapa3tkyl; BIGipServercaspit_https_vs=416223929.47873.0000'
),
));$response = curl_exec($curl);
curl_close($curl);
echo $response;
דוגמה נוספת: add_contact.php