/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
apikey | API KEY | You can get it from your profil https://app.Fideljet.com/profil then apikey section |
Email address | Contact email address, mandatory if mobile value is empty | |
mobile | Mobile | Contact mobile phone on international format (+33______) mandatory if email value is empty |
name | Full name | Contact full name |
gender | gender | Possible value (« F », « M » ou « -« ) |
member | Subscribe the contact to loyalty program | Possible value (1 ou 0) |
lists | Contact lists | Contact 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 contact | Value 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; } ?>