$dataApi = $sdk->getService()->getData();
- getLists
- getContact
- createContact
- updateContact
- deleteContact
- isContactBlacklisted
- addContactToBlacklist
- importContacts
Retrieve all lists from the specified universe. Returns EmailListCollection object.
Retrieve all infos about the user, including custom fields and subscribed lists.
Create a contact, see example below
Update a contact, you can view contact options on example below.
Delete a contact from email address
Return true if contact is in blacklist, false on the other hand.
Adding specified email to blacklist.
Adding contact collection (see Contact model) to export to Splio
$contact = new Splio\Service\Data\Contact\Contact();
$contact->setEmail('john@doe.com'); // required
$contact->setFirstname('John'); // optional
$contact->setLastname('Doe'); // optional
$user = $dataApi->createContact($contact);
$lists = $dataSdk->getLists();
$list1 = $lists->retrieveById(0);
$contact->addEmailList($list1);
$list2 = $lists->retrieveById(1);
$contact->addEmailList($list2);
$customFields = $dataSdk->getFields();
$field1 = $customFields->retrieveById(0);
$contact->addCustomField($field1);
$field2 = $customFields->retrieveById(1);
$contact->addCustomField($field2);
Here is the output :
{
"email": "john@doe.com",
"date": "2019-03-25 12:21:04",
"firstname": "John",
"lastname": "Doe",
"lang": "fr",
"cellphone": "",
"id": "1",
"fields": [
{
"id": "0",
"name": "Best character",
"value": "Jaina"
}
],
"lists": [
{
"id": "0",
"name": "Foo"
},
{
"id": "1",
"name": "Bar"
}
]
}