Solution SMS

Bannière Découvrez Dialog, une exclusivité Primotexto qui va révolutionner votre communication par SMS !

API SMS

Intégrez Primotexto à vos applications grâce à notre puissante API SMS.

  >  
Contacts  >  
Créer un contact






Créer un nouveau contact dans une liste  <->   Créer un nouveau contact dans une liste avec colonnes personalisées


Créer un nouveau contact dans une liste

Requête à envoyer

URL

https://api.primotexto.com/v2/lists/533e9f59e4b05d2efeb6f1b4

HTTP METHOD

POST

HEADERS

X-Primotexto-ApiKey: YOUR_API_KEY Content-Type: application/json

DATA

{ "identifier": "+33600000000" }

Retour de l'API


HEADERS

HTTP/1.1 200 OK Date: Fri, 08 Jan 2016 15:11:02 GMT Server: Apache Content-Type: application/json;charset=UTF-8 Vary: Accept-Encoding Transfer-Encoding: chunked

DATA

{ "id": "533e9f59e4b05d2efeb6f1b4" }
Identifiant de votre contact.
// Download library -> https://www.primotexto.com/api/librairies/latest-php.asp require_once 'primotexto-api-php/baseManager.class.php'; // Authentication authenticationManager::setApiKey('YOUR_API_KEY'); // Add $newContact = new PTContact(); $newContact->listId = $listId; $newContact->identifier = '+33600000000'; $contact = ListsManager::addContact($newContact); $contactId = json_decode($contact)->id;
curl -X POST \ -H "X-Primotexto-ApiKey: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"name":"API List #1"}' \ https://api.primotexto.com/v2/lists/
// Download library -> JDK 1.5 : https://www.primotexto.com/api/librairies/latest-jdk-1.5.zip // Download library -> JDK 1.6 : https://www.primotexto.com/api/librairies/latest-jdk-1.6.zip // Download library -> JDK 1.7 : https://www.primotexto.com/api/librairies/latest-jdk-1.7.zip import com.primotexto.*; // Authentication AuthenticationManager.setApiKey("YOUR_API_KEY"); // Add PTContact newContact = new PTContact(); newContact.setListId("551e68c0e4b094b0a124b392"); // newContact.setListId(listId); newContact.setIdentifier("+33600000000"); ListsManager.addContact(newContact);





Créer un nouveau contact dans une liste avec colonnes personalisées

Requête à envoyer

URL

https://api.primotexto.com/v2/lists/533e9f59e4b05d2efeb6f1b2/contacts

HTTP Method

POST

HEADERS

X-Primotexto-ApiKey: YOUR_API_KEY Content-Type: application/json

DATA

{ "identifier": "+33600000000", "attributes": { "543bda62e4b0275fbfb27aba": "NOM_DE_FAMILLE", "543bda3ce4b0275fbfb27ab9": "25/11" } }

Retour de l'API


HEADERS

HTTP/1.1 200 OK Date: Fri, 08 Jan 2016 15:11:02 GMT Server: Apache Content-Type: application/json;charset=UTF-8 Vary: Accept-Encoding Transfer-Encoding: chunked

DATA

{ "id": "533e9f59e4b05d2efeb6f1b5" }
Identifiant de votre contact.
// Download library -> https://www.primotexto.com/api/librairies/latest-php.asp require_once 'primotexto-api-php/baseManager.class.php'; // Authentication authenticationManager::setApiKey('5a312492501729be484e69bf16064d03'); // Add a contact with fields on list $newContact = new PTContact(); $newContact->listId = $listId; $newContact->identifier = '+33600000000'; $newContact->attributes["$nomDeFamilleId"] = "DUPONT"; $newContact->attributes["$anniversaireId"] = "17/12/1978"; $newContact->attributes["$inscritId"] = "1"; $contact = ListsManager::addContact($newContact); $contactId = json_decode($contact)->id;
curl -X POST \ -H "X-Primotexto-ApiKey: 5a312492501729be484e69bf16064d03" \ -H "Content-Type: application/json" \ -d '{ "identifier": "+33600000000","attributes": {"543bda62e4b0275fbfb27aba": "NOM_DE_FAMILLE", "543bda3ce4b0275fbfb27ab9": "25/11"}}' \ https://api.primotexto.com/v2/lists/533e9f59e4b05d2efeb6f1b2/contacts
// Download library -> JDK 1.5 : https://www.primotexto.com/api/downloads/java/primotexto-3.3-jdk-1.5.zip // Download library -> JDK 1.6 : https://www.primotexto.com/api/downloads/java/primotexto-3.3-jdk-1.6.zip // Download library -> JDK 1.7 : https://www.primotexto.com/api/downloads/java/primotexto-3.3-jdk-1.7.zip import com.primotexto.*; // Authentication AuthenticationManager.setApiKey("5a312492501729be484e69bf16064d03"); // Add a contact with fields on list PTContact newContact = new PTContact(); newContact.setListId(listId); newContact.setIdentifier("+33600000000"); newContact.setFieldValue(field1Id, "DUPONT"); newContact.setFieldValue(field2Id, "17/12"); newContact.setFieldValue(field3Id, "1"); ListsManager.addContact(newContact);