Skip to content

Instantly share code, notes, and snippets.

@luismec90
Created November 17, 2017 03:57
Show Gist options
  • Save luismec90/018bd488d0df4e3a9ab1ba29a982e2e7 to your computer and use it in GitHub Desktop.
Save luismec90/018bd488d0df4e3a9ab1ba29a982e2e7 to your computer and use it in GitHub Desktop.
<?php
$header = [
'Accept: application/json',
"Api-Appid:XXX",
"Api-Key:XXX",
];
$contact = [
'objectID' => 0,
'email' => 'luis@genesisdigital.co',
'firstname' => 'Luis',
'home_phone' => '+573113727751'
];
$path = 'http://api.ontraport.com/1/objects/saveorupdate';
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $path);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $contact);
$html = curl_exec($ch);
curl_close($ch);
echo $html;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment