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 ContactService

Performs all actions pertaining to Constant Contact Contacts

Ctct\Services\BaseService
Extended by Ctct\Services\ContactService
Namespace: Ctct\Services
Package: Services
Author: ContactContact
Located at Services/ContactService.php
Methods summary
public Ctct\Components\ResultSet
# getContacts( string $accessToken, array $params = array() )

Get a ResultSet of contacts

Get a ResultSet of contacts

Parameters

$accessToken
  • Constant Contact OAuth2 access token
$params
  • associative array of query parameters and values to append to the request. Allowed parameters include: limit - Specifies the number of results displayed per page of output, from 1 - 500, default = 50. modified_since - ISO-8601 formatted timestamp. next - the next link returned from a previous paginated call. May only be used by itself. email - full email address string to restrict results by status - a contact status to filter results by. Must be one of ACTIVE, OPTOUT, REMOVED, UNCONFIRMED.

Returns

Ctct\Components\ResultSet

Throws

Ctct\Exceptions\CtctException
public Ctct\Components\ResultSet
# getContactsFromList( string $accessToken, string $listId, array $params = array() )

Get all contacts from an individual list

Get all contacts from an individual list

Parameters

$accessToken
  • Constant Contact OAuth2 access token
$listId
  • ContactList id to retrieve contacts for
$params
  • associative array of query parameters and values to append to the request. Allowed parameters include: limit - Specifies the number of results displayed per page of output, from 1 - 500, default = 50. modified_since - ISO-8601 formatted timestamp. next - the next link returned from a previous paginated call. May only be used by itself. email - full email address string to restrict results by status - a contact status to filter results by. Must be one of ACTIVE, OPTOUT, REMOVED, UNCONFIRMED.

Returns

Ctct\Components\ResultSet

Throws

Ctct\Exceptions\CtctException
public Ctct\Components\Contacts\Contact
# getContact( string $accessToken, integer $contactId )

Get contact details for a specific contact

Get contact details for a specific contact

Parameters

$accessToken
  • Constant Contact OAuth2 access token
$contactId
  • Unique contact id

Returns

Ctct\Components\Contacts\Contact

Throws

Ctct\Exceptions\CtctException
public Ctct\Components\Contacts\Contact
# addContact( string $accessToken, Ctct\Components\Contacts\Contact $contact, array $params = array() )

Add a new contact to the Constant Contact account

Add a new contact to the Constant Contact account

Parameters

$accessToken
  • Constant Contact OAuth2 access token
$contact
  • Contact to add
$params
  • associative array of query parameters and values to append to the request. Allowed parameters include: action_by - Whether the contact is taking the action, or the account owner. Must be one of ACTION_BY_OWNER or ACTION_BY_VISITOR

Returns

Ctct\Components\Contacts\Contact

Throws

Ctct\Exceptions\CtctException
public boolean
# unsubscribeContact( string $accessToken, integer $contactId )

Opt out a contact

Opt out a contact

Parameters

$accessToken
  • Constant Contact OAuth2 access token
$contactId
  • Unique contact id

Returns

boolean

Throws

Ctct\Exceptions\CtctException
public Ctct\Components\Contacts\Contact
# updateContact( string $accessToken, Ctct\Components\Contacts\Contact $contact, array $params = array() )

Update contact details for a specific contact

Update contact details for a specific contact

Parameters

$accessToken
  • Constant Contact OAuth2 access token
$contact
  • Contact to be updated
$params
  • associative array of query parameters and values to append to the request. Allowed parameters include: action_by - Whether the contact is taking the action, or the account owner. Must be one of ACTION_BY_OWNER or ACTION_BY_VISITOR

Returns

Ctct\Components\Contacts\Contact

Throws

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