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 LibraryService

Super class for all services

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

Get files from the Library

Get files from the Library

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 - 1000, default = 50. sort_by - Specifies how the list of files is sorted; valid sort options are: CREATED_DATE, CREATED_DATE_DESC, MODIFIED_DATE, MODIFIED_DATE_DESC, NAME, NAME_DESC, SIZE, SIZE_DESC DIMENSION, DIMENSION_DESC source - Specifies to retrieve files from a particular source: ALL, MyComputer, Facebook, Instagram, Shutterstock, Mobile next - the next link returned from a previous paginated call. May only be used by itself.

Returns

Ctct\Components\ResultSet

Throws

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

Get files from the Library in a specific Folder

Get files from the Library in a specific Folder

Parameters

$accessToken
  • Constant Contact OAuth2 Access Token
$folderId
  • Specified Folder Id
$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 - 1000, default = 50. sort_by - Specifies how the list of files is sorted; valid sort options are: CREATED_DATE, CREATED_DATE_DESC, MODIFIED_DATE, MODIFIED_DATE_DESC, NAME, NAME_DESC, SIZE, SIZE_DESC DIMENSION, DIMENSION_DESC source - Specifies to retrieve files from a particular source: ALL, MyComputer, Facebook, Instagram, Shutterstock, Mobile next - the next link returned from a previous paginated call. May only be used by itself.

Returns

Ctct\Components\ResultSet

Throws

Ctct\Exceptions\CtctException
public Ctct\Components\Library\File
# getLibraryFile( string $accessToken, string $fileId )

Get File by Id

Get File by Id

Parameters

$accessToken
  • Constant Contact OAuth2 Access Token
$fileId
  • Specified File Id

Returns

Ctct\Components\Library\File

Throws

Ctct\Exceptions\CtctException
public boolean
# deleteLibraryFile( string $accessToken, string $fileId )

Delete a File

Delete a File

Parameters

$accessToken
  • Constant Contact OAuth2 Access Token
$fileId
  • Specified File Id

Returns

boolean

Throws

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

Get folders from the Library

Get folders from the Library

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 - 1000, default = 50. sort_by - Specifies how the list of files is sorted; valid sort options are: CREATED_DATE, CREATED_DATE_DESC, MODIFIED_DATE, MODIFIED_DATE_DESC, NAME, NAME_DESC

Returns

Ctct\Components\ResultSet

Throws

Ctct\Exceptions\CtctException
public Ctct\Components\Library\Folder
# getLibraryFolder( string $accessToken, string $folderId )

Get a specific Folder

Get a specific Folder

Parameters

$accessToken
  • Constant Contact OAuth2 Access Token
$folderId
  • ID of the Folder

Returns

Ctct\Components\Library\Folder

Throws

Ctct\Exceptions\CtctException
public boolean
# deleteLibraryFolder( string $accessToken, string $folderId )

Delete a Library Folder

Delete a Library Folder

Parameters

$accessToken
  • Constant Contact OAuth2 Access Token
$folderId
  • ID of the Folder

Returns

boolean

Throws

Ctct\Exceptions\CtctException
public string
# uploadFile( string $accessToken, string $fileName, string $fileLocation, string $description, string $source, string $folderId )

Upload a file to the Library. Must be one of PNG, JPG, JPEG, GIF, or PDF. The server scans files for viruses, so this returns an ID for a FileUploadStatus.

Upload a file to the Library. Must be one of PNG, JPG, JPEG, GIF, or PDF. The server scans files for viruses, so this returns an ID for a FileUploadStatus.

Parameters

$accessToken
  • Constant Contact Oauth2 Access Token
$fileName
  • Name of the file
$fileLocation
  • Path to the location of the file on the server
$description
  • Description of the file
$source
  • Source
$folderId
  • Folder ID to upload file to. Set as 0 for no folder.

Returns

string
File upload status ID

Throws

Ctct\Exceptions\IllegalArgumentException
if file type is not one listed in the description
Ctct\Exceptions\CtctException
public Ctct\Components\Library\FileUploadStatus[]
# getFileUploadStatus( string $accessToken, string $uploadStatusIds )

Get the status of a File upload

Get the status of a File upload

Parameters

$accessToken
  • Constant Contact OAuth2 token
$uploadStatusIds
  • Single ID or ID's of statuses to check, separated by commas (no spaces)

Returns

Ctct\Components\Library\FileUploadStatus[]
  • Array of FileUploadStatus

Throws

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