Creating a List

Create a List via the Web Service.


Function

  • createList()

Parameters

  • username: String
    • Account login name.
  • password: String
    • Account password.
  • listname: String
    • name of the list.
  • brand: String
    • any human readable name used for list purpose
  • isProofList: boolean
    • is this list a proof list
  • fieldNames: String[]
    • custom field names for the list. Maximum 25 fields allowed.

Return

  • int:
    • List ID: The new List's list ID
    • 0: create Failed

Exception

  • PuresendException

Documentation

  • If you are using custom field names, do not specify 'Email' as this is already defined by Puresend and has its on setter function.

  • Passing in 'null' for the field names will use the default Puresend list master info.


Examples

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

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

        String username = "XXX";
        String password = "XXX";

        String listName = "Enter Non Existing Name";
        String brandName = "Brand Name";
        boolean isProofList = false;
        List<String> listFieldValues = new ArrayList<>();
        listFieldValues.add("FirstName");
        listFieldValues.add("LastName");
        listFieldValues.add("Address");

        int listId = port.createList(username, password, listName, brandName, isProofList, listFieldValues);

}    

<?php
include 'puresend.php';

$p = new Puresend();

$createListData = new createList();
$createListData->username = 'XXX';
$createListData->password = 'XXX';
$createListData->listname = "Enter Non Existing Name";
$createListData->brandname = "Brand Name";
$createListData->isProofList = false;
$createListData->fieldNames = array("FirstName", "LastName", "Address");

$response = $p->createList($createListData);
var_dump($response);

?>