Easy and simple API Documentation.
API Documentation
All the examples given here are for you to implement, copy, or modify to your own needs. If you need customer service or support please be sure to contact us using our contact form here.
Add contact
To add a contact, you can send a JSON format that contains the IDs of the custom fields that you want the added contact to have: below is an example of how to send data
'Secret Key');
$data[] = array(
'type' => "NEW", //type action
'Number' => "+16193596440", //string
'Email' => 'exaple@example.com', //string
'Fname' => 'firtsName', //string
'Lname' => 'lastName', //string
'Custom' => array(
'idCustom' => 'valueCustom',
'idCustom' => 'valueCustom',
'idCustom' => 'valueCustom'
),
'Opportunitie' => TRUE //BOOL (OPTIONAL)- DEFAULT FALSE
);
// Convert data to JSON format
$json_data = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Execute cURL request
$response = curl_exec($ch); //RESPONSE ID DATA
?>
Edit contact
To edit the data of a previously created contact, you need the user identifier, you will also need to define the type field in EDIT to perform the action
'');
$data[] = array(
'type' => "EDIT", //type action required
'Number' => "+526600000000", //string
'Email' => 'exaple@example.com', //string
'idContact' => 0 //required id contact
);
// Convert data to JSON format
$json_data = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Execute cURL request
$response = curl_exec($ch); //RESPONSE ID DATA
?>
Delete contact
To delete a contact created from the API, you only need to send the contact identifier: the following example shows how to do it
'');
$data[] = array(
'type' => "TRASH", //type action
'idContact' => 0//id contact
);
// Convert data to JSON format
$json_data = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Execute cURL request
$response = curl_exec($ch); //RESPONSE Status
?>
Search contacts
To perform a search, you can do it using first or last names, even by contact ID. The following example shows how to do it.
'');
$data[] = array(
'type' => "SEARCH", //type action
'Lname' => "pedro", //string
'Fname' => 'juan', //string
'idContact' => 0 //id contact
);
// Convert data to JSON format
$json_data = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Execute cURL request
$response = curl_exec($ch); //RESPONSE ID DATA
?>
Add to automation
If you want to add a contact to an automation from the API you must send the ID of your automation, along with the ID of the contact you want to add, the automation must be turned on and with nodes to be able to work: the following example shows you how to do it
'Secret Key');
$data[] = array(
'idContact' => 10, //id contact
'idAuto' => 10 //id automation
);
// Convert data to JSON format
$json_data = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Execute cURL request
$response = curl_exec($ch);
?>
Send call
To make a call you only have to send the necessary data to our Endpoint through POST in JSON format to be processed.
Below we present an example.
'Secret Key');
$data[] = array(
'number' => "+526643596440",
'text' => 'Hello, your package ',
'type' => 'CALL'
);
// Convert data to JSON format
$json_data = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Execute cURL request
$response = curl_exec($ch);
?>
Send SMS
To make a SMS you only have to send the necessary data to our Endpoint through POST in JSON format to be processed.
Below we present an example.
'Secret Key');
$data[] = array(
'number' => "+526643596440",
'text' => 'Hello, your package ',
'type' => 'SMS'
);
// Convert data to JSON format
$json_data = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Execute cURL request
$response = curl_exec($ch);
?>