1. Accueil
  2. API
  3. Add / update contact

Add / update contact

/addcontact

Fideljet provides a API to allow you to add contact directly to your account from your application, website or service

  • Endpoint: https://app.fideljet.com/rest/addcontact
  • Type: Post

 

apikeyAPI KEYYou can get it from your profil
https://app.Fideljet.com/profil then apikey section
emailEmail addressContact email address, mandatory if mobile value is empty
mobileMobileContact mobile phone on international format (+33______)
mandatory if email value is empty
nameFull name Contact full name
gendergender Possible value (« F », « M » ou « -« )
memberSubscribe the contact to loyalty programPossible value (1 ou 0)
listsContact listsContact lists Ids, with , as separator in case you need to add the contact to multiple list
you can get Id from Contacts->lists->edit
update Update or create contactValue 0: Create a new contact
Value 1: update existing contact
Email address is mandatory for update

 

Here is a PHP exemple:

<?php

$curl = curl_init();
$apikey = "YOUR_API_KEY";
$email = "[email protected]"; // Email address
$mobile = "+3300000000"; // International mobile format with +
$name = "My name"; // Contact name
$gender = "-"; // "F" or "M" or "-"
$member = 0; // 1 or 0, to subscribe contact to loyalty program
$lists = '_liste_ID_'; // Lists id with , separator
$update = 0; // 1 for update, 0 for insert, Email is required to update contact

/*
Exemple result
{
"message":"Success",
"success":true
}

*/
curl_setopt_array($curl, array(
CURLOPT_URL => "https://app.fideljet.com/rest/addcontact",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{ \"apikey\":\"$apikey\", \"email\":\"$email\", \"mobile\":\"$mobile\", \"name\":\"$name\", \"gender\":\"$gender\", \"member\":\"$member\", \"update\":\"$update\", \"lists\":\"$lists\" }",
CURLOPT_HTTPHEADER => array(
"accept: application/json",
"content-type: application/json"
),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}

?>

Cet article vous a-t-il été utile ? Oui Non