Overview

Namespaces

  • Ctct
    • Auth
    • Components
      • Account
      • Activities
      • Contacts
      • EmailMarketing
      • Library
      • Tracking
    • Exceptions
    • Services
    • Util
    • WebHooks

Classes

  • AccountService
  • ActivityService
  • BaseService
  • CampaignScheduleService
  • CampaignTrackingService
  • ContactService
  • ContactTrackingService
  • EmailMarketingService
  • LibraryService
  • ListService
  • Overview
  • Namespace
  • Class

Class ActivityService

Performs all actions pertaining to scheduling Constant Contact Activities

Ctct\Services\BaseService
Extended by Ctct\Services\ActivityService
Namespace: Ctct\Services
Package: Services
Author: ConstantContact
Located at Services/ActivityService.php
Methods summary
public array
# getActivities( string $accessToken, array $params = array() )

Get an array of activities

Get an array of activities

Parameters

$accessToken
  • Constant Contact OAuth2 access token
$params
  • associative array of query parameters and values to append to the request. Allowed parameters include: status - Status of the activity, must be one of UNCONFIRMED, PENDING, QUEUED, RUNNING, COMPLETE, ERROR type - Type of activity, must be one of ADD_CONTACTS, REMOVE_CONTACTS_FROM_LISTS, CLEAR_CONTACTS_FROM_LISTS, EXPORT_CONTACTS

Returns

array
  • Array of all ActivitySummaryReports

Throws

Ctct\Exceptions\CtctException
public array
# getActivity( string $accessToken, string $activityId )

Get an array of activities

Get an array of activities

Parameters

$accessToken
  • Constant Contact OAuth2 access token
$activityId
  • Activity id

Returns

array
  • Array of all ActivitySummaryReports

Throws

Ctct\Exceptions\CtctException
public array
# createAddContactsActivity( string $accessToken, Ctct\Components\Activities\AddContacts $addContacts )

Create an Add Contacts Activity

Create an Add Contacts Activity

Parameters

$accessToken
  • Constant Contact OAuth2 access token
$addContacts

Returns

array
  • Array of all ActivitySummaryReports

Throws

Ctct\Exceptions\CtctException
public Ctct\Components\Activities\Activity
# createAddContactsActivityFromFile( string $accessToken, string $fileName, string $fileLocation, string $lists )

Create an Add Contacts Activity from a file. Valid file types are txt, csv, xls, xlsx

Create an Add Contacts Activity from a file. Valid file types are txt, csv, xls, xlsx

Parameters

$accessToken
  • Constant Contact OAuth2 access token
$fileName
  • The name of the file (ie: contacts.csv)
$fileLocation
  • The location of the file on the server, this method uses fopen()
$lists
  • Comma separated list of ContactList id's to add the contacts to

Returns

Ctct\Components\Activities\Activity

Throws

Ctct\Exceptions\CtctException
public Ctct\Components\Activities\Activity
# addClearListsActivity( $accessToken, array $lists )

Create a clear lists activity. This removes all contacts on the selected lists while keeping the list itself intact.

Create a clear lists activity. This removes all contacts on the selected lists while keeping the list itself intact.

Parameters

$accessToken
Constant Contact OAuth2 access token
$lists
  • Array of list ID's to be cleared

Returns

Ctct\Components\Activities\Activity

Throws

Ctct\Exceptions\CtctException
public array
# addExportContactsActivity( string $accessToken, Ctct\Components\Activities\ExportContacts $exportContacts )

Create an Export Contacts Activity

Create an Export Contacts Activity

Parameters

$accessToken
  • Constant Contact OAuth2 access token
$exportContacts

Returns

array
  • Array of all ActivitySummaryReports

Throws

Ctct\Exceptions\CtctException
public Ctct\Components\Activities\Activity
# addRemoveContactsFromListsActivity( $accessToken, array $emailAddresses, array $lists )

Create a Remove Contacts from Lists Activity

Create a Remove Contacts from Lists Activity

Parameters

$accessToken
Constant Contact OAuth2 access token
$emailAddresses
  • array of email addresses to remove
$lists
  • array of list ID's to remove the provided email addresses from

Returns

Ctct\Components\Activities\Activity

Throws

Ctct\Exceptions\CtctException
public Ctct\Components\Activities\Activity
# addRemoveContactsFromListsActivityFromFile( string $accessToken, string $fileName, string $fileLocation, string $lists )

Create a Remove Contacts Activity from a file. Valid file types are txt, csv, xls, xlsx

Create a Remove Contacts Activity from a file. Valid file types are txt, csv, xls, xlsx

Parameters

$accessToken
  • Constant Contact OAuth2 access token
$fileName
  • The name of the file (ie: contacts.csv)
$fileLocation
  • The location of the file on the server, this method uses fopen()
$lists
  • Comma separated list of ContactList id's to add the contacts to

Returns

Ctct\Components\Activities\Activity

Throws

Ctct\Exceptions\CtctException
Methods inherited from Ctct\Services\BaseService
__construct(), convertException(), createBaseRequest(), getClient()
API documentation generated by ApiGen