Add Contact To List

Add an email/contact with associated fields to the specified list.


Function

  • addContactToList()

Parameters

  • username: String
    • Account login name.
  • password: String
    • Account password.
  • listId: int
    • id of the list to which the email will be added to
  • email: String
    • email address to be added
  • fieldValues: String[]
    • [OPTIONAL] array of the field values as specified for the list. This will constitute one entry in the list.
  • allowDuplcates: boolean
    • [OPTIONAL] insert an email even if it exists in the list specified.
  • actionCode: int
    • [OPTIONAL] - level of how to handle duplicated email.
      • 0: failure.
      • 1: return existing record if email existed in the list specified.

Return

  • Contact:
    • added Contact object.

Exception

  • Exception

Documentation

  • Add an email/contact with associated fields to the specified list.

Examples

public void addContactToListSample() throws java.lang.Exception {

        Puresend p = new Puresend();
        PuresendPortType ppt = p.getPuresendHttpsSoap12Endpoint();

        String username = "XXX";
        String password = "XXX";
        String listId = 1234;
        String email = "sample@email.com";
        String[] fieldValues = new String[]{"xxx", "xxx", "xxx"};
        boolean allowDuplicates = false;
        int actionCode = 0;

        Contact contact = ppt.addContactToList(username, 
                                password, 
                                listName, 
                                email, 
                                fieldValues, 
                                allowDuplicates, 
                                actionCode);
}
<?php
include 'puresend.php';

$p = new Puresend();

$addContactToListData = new addContactToList();
$addContactToListData->username = 'XXX';
$addContactToListData->password = 'XXX';
$addContactToListData->listId = 1234;
$addContactToListData->email = 'sample@email.com';
$addContactToListData->fieldValues = array("xxx", "xxx", "xxx");
$addContactToListData->allowDuplicates = false;

$response = $p->addContactToList($addContactToListData);
var_dump($response);

?>