Copied!
CloneableInstantiable
Methods
public __construct(PHPFUI\ConstantContact\Client $client)
public PHPFUI\ConstantContact\Base::getLastError() : string
public PHPFUI\ConstantContact\Base::getResponseText() : string
public PHPFUI\ConstantContact\Base::getStatusCode() : int
public PHPFUI\ConstantContact\Base::next() : array
 

If the endpoint is paginated, you can call next() to retrieve the next set of data. If no next is provided, an empty array is returned.

  • return array filled with next part of the response from the endpoint, or empty if no next.
public post(string $file, string $list_ids, ?string $sms_permission_to_send = NULL) : ?array
 

Import Contacts using a CSV File

This multipart method creates an asynchronous background job that adds or updates contacts by importing a CSV file containing contact information. Do not use a Content-Type header value with this method.

Importing a new contact email address automatically sets the contact's permission_to_send property as implicit and the opt_in_source property as Account. Importing an existing contact only updates the contact properties you include in the request. Importing contacts with sms_numbers requires using the sms_permission_to_send parameter to specify permissions for all contacts being imported. Set to explicit to specify that all contacts either provided explicit permission. Set to not_set if permission was not provided. If explicit, you must also include the sms_consent_date as a column header to include the date the contact consented to receiving SMS messages. Contacts must have either an email address or an SMS number defined.

The CSV file has a maximum of 40,000 lines including the header row (39,999 contacts) and a maximum file size of 4 megabytes (MB). Lines above the 40,000 line maximum are not processed. If the request body exceeds 4 MB, only the contacts contained in the first 4 MB are imported and the remaining data is dropped.

  • param string $file The CSV file you are importing must include either email or sms_number as a column heading. Other properties you can include using column headings are: first_name. last_name, phone, job_title, anniversary, birthday_day, birthday_month, company_name, street, street2, city, state, zip, country, and sms_consent_date. If adding an sms_number, you must also include the sms_permission_to_send parameter and set it to either not_set or explicit. If explicit, requires including sms_consent_date as a column header to specify the date the contact consented to receiving SMS messages. You can also use custom fields as column headings. Enter the custom field name prefixed with cf: as the column heading. For example, use cf:first_name as the header name if you have a custom field named "first_name". The custom field must already exist in the Constant Contact account you are using. Depending on the custom field data type, you can enter dates or strings as the value of the custom field. Each contact can contain up to 25 different custom fields.
  • param string $list_ids Specify which contact lists you are adding all imported contacts to as an array of up to 50 contact list_id values.
  • param string $sms_permission_to_send If importing contact sms_numbers, use this parameter to specify how SMS consent was provided. If all contacts in the file provided their consent, set to explicit and include each contact's sms_consent_date. If all contacts in the file have not yet provided consent, set to not_set (sms_consent_date is not required). You cannot message a contact that does not have a sms consent date set.
public postTyped(string $file, string $list_ids, ?string $sms_permission_to_send = NULL) : ?PHPFUI\ConstantContact\Definition\ActivityImport
public PHPFUI\ConstantContact\Base::success() : bool
Properties
protected PHPFUI\ConstantContact\Client PHPFUI\ConstantContact\Base::$client
protected string PHPFUI\ConstantContact\Base::$urlPath
Methods
protected PHPFUI\ConstantContact\Base::doDelete(array $parameters) : ?array
protected PHPFUI\ConstantContact\Base::doGet(array $parameters) : ?array
protected PHPFUI\ConstantContact\Base::doPatch(array $parameters) : ?array
protected PHPFUI\ConstantContact\Base::doPost(array $parameters) : ?array
protected PHPFUI\ConstantContact\Base::doPut(array $parameters) : ?array
© 2026 Bruce Wells
Search Namespaces \ Classes
Configuration