\FuelSdkET_Client

Defines a Client interface class which manages the authentication process.

This is the main client class which performs authentication, obtains auth token, if expired refresh auth token. Settings/Configuration can be passed to this class during construction or set it in config.php file. Configuration passed as parameter overrides the values from the configuration file.

Summary

Methods
Properties
Constants
__construct()
refreshToken()
__getLastResponseHTTPCode()
CreateWSDL()
GetLastModifiedDate()
__doRequest()
addOAuth()
getAuthToken()
setAuthToken()
getAuthTokenExpiration()
getInternalAuthToken()
setInternalAuthToken()
setRefreshToken()
getRefreshToken()
AddSubscriberToList()
AddSubscribersToLists()
CreateDataExtensions()
SendTriggeredSends()
SendEmailToList()
SendEmailToDataExtension()
CreateAndStartListImport()
CreateAndStartDataExtensionImport()
CreateProfileAttributes()
CreateContentAreas()
$packageName
$packageFolders
$parentFolders
$proxyHost
$proxyPort
$proxyUserName
$proxyPassword
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$wsdlLoc
$debugSOAP
$lastHTTPCode
$clientId
$clientSecret
$appsignature
$endpoint
$tenantTokens
$tenantKey
$xmlLoc
$baseUrl
$baseAuthUrl
N/A

Properties

$packageName

$packageName : string

Type

string — Folder/Package Name

$packageFolders

$packageFolders : array

Type

array — Array of Folder object properties.

$parentFolders

$parentFolders : \FuelSdk\ET_Folder

Type

\FuelSdk\ET_Folder — Parent folder object.

$proxyHost

$proxyHost : string

Type

string — Proxy host.

$proxyPort

$proxyPort : string

Type

string — Proxy port.

$proxyUserName

$proxyUserName : string

Type

string — Proxy username.

$proxyPassword

$proxyPassword : string

Type

string — Proxy password.

$wsdlLoc

$wsdlLoc : 

Type

$debugSOAP

$debugSOAP : 

Type

$lastHTTPCode

$lastHTTPCode : 

Type

$clientId

$clientId : 

Type

$clientSecret

$clientSecret : 

Type

$appsignature

$appsignature : 

Type

$endpoint

$endpoint : 

Type

$tenantTokens

$tenantTokens : 

Type

$tenantKey

$tenantKey : 

Type

$xmlLoc

$xmlLoc : 

Type

$baseUrl

$baseUrl : 

Type

$baseAuthUrl

$baseAuthUrl : 

Type

Methods

__construct()

__construct(boolean  $getWSDL = false, boolean  $debug = false, array  $params = null) 

Initializes a new instance of the ET_Client class.

Parameters

boolean $getWSDL

Flag to indicate whether to load WSDL from source. If true, WSDL is load from the source and saved in to path set in xmlLoc variable. If false, WSDL stored in the path set in xmlLoc is loaded.

boolean $debug

Flag to indicate whether debug information needs to be logged. Logging is enabled when the value is set to true and disabled when set to false.

array $params

Array of settings as string.
Following are the possible settings.
defaultwsdl - WSDL location/path
clientid - Client Identifier optained from App Center
clientsecred - Client secret associated with clientid
appsignature - Application signature optained from App Center
baseUrl - ExactTarget SOAP API Url
baseAuthUrl - ExactTarget authentication rest api resource url
If your application behind a proxy server, use the following setting
proxyhost - proxy server host name or ip address
proxyport - proxy server prot number
proxyusername - proxy server user name
proxypassword - proxy server password

refreshToken()

refreshToken(boolean  $forceRefresh = false) : void

Gets the refresh token using the authentication URL.

Parameters

boolean $forceRefresh

Flag to indicate a force refresh of authentication toekn.

__getLastResponseHTTPCode()

__getLastResponseHTTPCode() : \FuelSdk\lastHTTPCode

Returns the HTTP code return by the last SOAP/Rest call

Returns

\FuelSdk\lastHTTPCode

CreateWSDL()

CreateWSDL(  $wsdlLoc) : void

Create the WSDL file at specified location.

Parameters

$wsdlLoc

GetLastModifiedDate()

GetLastModifiedDate(\FuelSdk\[type]  $remotepath) : string

Returns last modified date of the URL

Parameters

\FuelSdk\[type] $remotepath

Returns

string —

Last modified date

__doRequest()

__doRequest(string  $request, string  $location, string  $saction, string  $version, integer  $one_way) : string

Perfoms an soap request.

Parameters

string $request

Soap request xml

string $location

Url as string

string $saction

Soap action name

string $version

Future use

integer $one_way

Future use

Returns

string —

Soap web service request result

addOAuth()

addOAuth(string  $doc, string  $token) : void

Add OAuth token to the header of the soap request

Parameters

string $doc

Soap request as xml string

string $token

OAuth token

getAuthToken()

getAuthToken(  $tenantKey = null) : string

Get the authentication token.

Parameters

$tenantKey

Returns

string

setAuthToken()

setAuthToken(string  $tenantKey, string  $authToken, string  $authTokenExpiration) 

Set the authentication token in the tenantTokens array.

Parameters

string $tenantKey

Tenant key for which auth toke to be set

string $authToken

Authentication token to be set

string $authTokenExpiration

Authentication token expiration value

getAuthTokenExpiration()

getAuthTokenExpiration(string  $tenantKey) : string

Get the Auth Token Expiration.

Parameters

string $tenantKey

Tenant key for which authenication token is returned

Returns

string —

Authenticaiton token for the tenant key

getInternalAuthToken()

getInternalAuthToken(string  $tenantKey) : string

Get the internal authentication token.

Parameters

string $tenantKey

Returns

string —

Internal authenication token

setInternalAuthToken()

setInternalAuthToken(string  $tenantKey, string  $internalAuthToken) 

Set the internal auth tokan.

Parameters

string $tenantKey
string $internalAuthToken

setRefreshToken()

setRefreshToken(string  $tenantKey, string  $refreshToken) 

Set the refresh authentication token.

Parameters

string $tenantKey

Tenant key to which refresh token is set

string $refreshToken

Refresh authenication token

getRefreshToken()

getRefreshToken(string  $tenantKey) : string

Get the refresh token for the tenant.

Parameters

string $tenantKey

Returns

string —

Refresh token for the tenant

AddSubscriberToList()

AddSubscriberToList(string  $emailAddress, array  $listIDs, string  $subscriberKey = null) : mixed

Add subscriber to list.

Parameters

string $emailAddress

Email address of the subscriber

array $listIDs

Array of list id to which the subscriber is added

string $subscriberKey

Newly added subscriber key

Returns

mixed —

post or patch response object. If the subscriber already existing patch response is returned otherwise post response returned.

AddSubscribersToLists()

AddSubscribersToLists(  $subs,   $listIDs) 

Parameters

$subs
$listIDs

CreateDataExtensions()

CreateDataExtensions(array  $dataExtensionDefinitions) : mixed

Create a new data extension based on the definition passed

Parameters

array $dataExtensionDefinitions

Data extension definition properties as an array

Returns

mixed —

post response object

SendTriggeredSends()

SendTriggeredSends(array  $arrayOfTriggeredRecords) : mixed

Starts an send operation for the TriggerredSend records

Parameters

array $arrayOfTriggeredRecords

Array of TriggeredSend records

Returns

mixed —

Send reponse object

SendEmailToList()

SendEmailToList(string  $emailID, string  $listID, string  $sendClassficationCustomerKey) : mixed

Create an email send definition, send the email based on the definition and delete the definition.

Parameters

string $emailID

Email identifier for which the email is sent

string $listID

Send definition list identifier

string $sendClassficationCustomerKey

Send classification customer key

Returns

mixed —

Final delete action result

SendEmailToDataExtension()

SendEmailToDataExtension(string  $emailID, string  $sendableDataExtensionCustomerKey, string  $sendClassficationCustomerKey) : mixed

Create an email send definition, send the email based on the definition and delete the definition.

Parameters

string $emailID

Email identifier for which the email is sent

string $sendableDataExtensionCustomerKey

Sendable data extension customer key

string $sendClassficationCustomerKey

Send classification customer key

Returns

mixed —

Final delete action result

CreateAndStartListImport()

CreateAndStartListImport(string  $listId, string  $fileName) : mixed

Create an import definition and start the import process

Parameters

string $listId

List identifier. Used as the destination object identifier.

string $fileName

Name of the file to be imported

Returns

mixed —

Returns the import process result

CreateAndStartDataExtensionImport()

CreateAndStartDataExtensionImport(string  $dataExtensionCustomerKey, string  $fileName, boolean  $overwrite) : mixed

Create an import definition and start the import process

Parameters

string $dataExtensionCustomerKey

Data extension customer key. Used as the destination object identifier.

string $fileName

Name of the file to be imported

boolean $overwrite

Flag to indicate to overwrite the uploaded file

Returns

mixed —

Returns the import process result

CreateProfileAttributes()

CreateProfileAttributes(array  $allAttributes) : mixed

Create a profile attribute

Parameters

array $allAttributes

Profile attribute properties as an array.

Returns

mixed —

Post operation result

CreateContentAreas()

CreateContentAreas(array  $arrayOfContentAreas) : void

Create one or more content areas

Parameters

array $arrayOfContentAreas

Content areas properties as an array