bus_facade_campaign_one2one


**Description :** Used in the scheduling and management of deliveries within the platform.
**Default Methods** Please ensure you're familiar with... - [**Introduction to Beans**](/documentation/soap/gettingstarted/beans) - [**Requests and Responses**](/documentation/soap/gettingstarted/requests) - [**Anatomy of a session**](/documentation/soap/gettingstarted/session)
**Unique Methods** To call these methods use the following example structure...
paintRequest:
contextId   string  :   C-KFDsCMMHXpDUi0ltN0p3FvF
className   string  :   bus_facade_campaign_one2one
processName string  :   methodName  i.e. changeMessage
entityData  array   :   i.e. array('beanId'  => ID of the bean (created/updated/loaded) in the bean store)
processData array   :   i.e. array('message_messageName'  => Unique name of the message, a parameter for the process)
Name Parameters Description
changeMessage Entity Data : beanId
Process Data :message_contentType, message_messageName ormessage_messageId
This method checks the process data for the existence of messsage_messageName or message_messageId which can refer to an existing message in the system and message_contentType (EMAIL or SMS) which will define the type of bean to be created during the method. The contentType is mandatory. If no name or id is specified for the message, a new message will be created (but not permanently stored) and the writeable variables used in the update or store method will need to be used to configure the message. The one 2 one will not be triggered untill the store process is called

Example Process - Sending a one 2 one email

WSDL Our WSDL defines our web service and where to locate our web service. In understanding these examples please familiarise yourself with the handleRequest (paintRequest / paintResponse)
Step 1 : Begin by creating an empty one2one entity in the bean store and obtain a reference to this...


**Example Request / Response:**
paintRequest:
contextId   string  :   C-KFDsCMMHXpDUi0ltN0p3FvF
className   string  :   bus_facade_campaign_one2one
processName string  :   create
entityData  array   :   null
processData array   : 
			'message_messageName'  => Unique message name within the platform (if using an existing messasge)
			'message_contentType'  => Type of the message being sent EMAIL or SMS
paintResponse:
Result   array :   
      	 'result'     => "success"
		 'resultData' => array : 
						 'bus_entity_campaign_one2one'  => array
            			 ... => ...
						 ...  variables  ...
         				 ... => ...
						 'beanId' => ID for new empty email bean in bean store

**Step 2 :** Next, choose the writable attributes, both required and optional and update the new entity bean in the bean store... * Use the contextId to reference the current session in progress (generated during a login request - bus_facade_context * To access the one2one entities use the campaign one2one entry point/gateway * Perform an update process with the writeable parameters that make up the one2one creation process, the bean id of the new bean entity in the bean store returned from the create request, plus any optional parameters. **Example Request / Response**
paintRequest:
contextId   string  :   C-KFDsCMMHXpDUi0ltN0p3FvF
className   string  :   bus_facade_campaign_one2one
processName string  :   update
entityData  array   : 
			'beanId'  => ID of the empty bean returned during the create
			... => ...
			...  Required & optional variables  ...
			... => ...

processData array   :  null
paintResponse:
Result   array :
      	 'result'     => "success"
		 'resultData' => array
		                 'bus_entity_campaign_one2one' => array
                                                          'contentBeanId' => "6da038682d68175495cac627c04e0791"
										                  ...  variables  ...
                                                          'beanName' => "bus_entity_campaign_email"

**Step 3 :** Finally complete a store request with the bean id of the new entity in the bean store to write this back to the platform and remove the bean from the bean store... * Use the contextId to reference the current session in progress (generated during a login request - bus_facade_context * To access the one2one entities use the campaign one2one entry point/gateway * Perform a store process with the entity data parameter as the bean id of the new entity that has been created and updated. **Example Request / Response**
paintRequest:
contextId   string  :   C-KFDsCMMHXpDUi0ltN0p3FvF
className   string  :   bus_facade_campaign_one2one
processName string  :   store
entityData  array   :   'beanId'  => ID of the bean in the bean store
processData array   :   null
paintResponse:
Result   array :
      	 'result'     => "success"
		 'resultData' => array
		                 'bus_entity_campaign_one2one' => array
                                                          'deliveryId' => 0123456
										                  ...  variables  ...
                                                          'deliveryReportId' => 0123456

bus_entity_campaign_one2one

ProcessData Variables : CREATE (Required)

Name Example Description
message_messageName_base64
"QXVndXN0X0RlYWxz"
The recommended method to send string data, base 64 encoded. This variable is the name of an existing message in the system to use for this one2one delivery, used by the process and not stored on the one2one entity.
Not required if "message_messageId" given
message_messageName
"August_Deals"
If you are unable to base 64 encode strings then use this variable as the name of an existing message in the system to use for this one2one delivery, used by the process and not stored on the one2one entity.
Not required if "message_messageId" given
message_messageId
6564541
The ID of an existing message in the system to use for this one2one delivery, used by the process and not stored on the one2one entity.
Not required if "message_messageName" given
message_contentType
"EMAIL" 
"SMS"
Type of delivery being sent. The One to One bean needs to know this to determine what form of validation to perform on the recipient's details (email or mobile validation) and which person record to retrieve.

ProcessData Variables : CREATE
(Optional : Only required if messageName/messageId Omitted.)


The message will ONLY be used for this delivery and will NOT be stored on the platform. Used by the process and not the entity.
Name Example Description
message_bodyHtml_base64
"PGgxPkhlYWRlcjwvaDE+DQo8YnIgLz4NCkVtYWlsIHRvIHt+Zmlyc3RfbmFtZX59"
The recommended method to send string data, base 64 encoded. This variable is the HTML content of the message to use for this one2one delivery, used by the process and not stored on the one2one entity
message_bodyHtml
<h1>Header</h1><br />
Email to {~first_name~}
If you are unable to base 64 encode strings, then use this variable as the HTML content of the message to use for this one2one delivery, used by the process and not stored on the one2one entity
message_bodyPlain_base64
"LS0tLS1IZWFkZXItLS0tLQ0KRW1haWwgdG8ge35maXJzdF9uYW1lfn0="
The recommended method to send string data, base 64 encoded. This variable is the PLAIN TEXT content of the message to use for this one2one delivery, used by the process and not stored on the one2one entity
message_bodyPlain
"Header
---------
Email to {~first_name~}"
If you are unable to base 64 encode strings, then use this variable as the PLAIN TEXT content of the message to use for this one2one delivery, used by the process and not stored on the one2one entity
message_bodySms_base64
"VGV4dCB0byB7fmZpcnN0X25hbWV+fQ==="
The recommended method to send string data, base 64 encoded. This variable is the SMS content of the message to use for this one2one delivery, used by the process and not stored on the one2one entity
message_bodySMS
"Text to {~first_name~}"
If you are unable to base 64 encode strings, then use this variable as the SMS content of the message to use for this one2one delivery, used by the process and not stored on the one2one entity
message_subject_base64
"QXByaWwgRGVhbHMh"
The recommended method to send string data, base 64 encoded. This variable is the subject line to appear in the message sent. Note that the subject line will be converted into the character set of the message on sending.
message_subject
"April Deals"
If you are unable to base 64 encode strings, then use this variable as the subject line to appear in the message sent. Note that the subject line will be converted into the character set of the message on sending.
message_languageCode
"en_GB.ISO8859-15"
Language code for this message.
If omitted: Profile default language code used for this message.
message_templateName
"email-msg-default_centered"
The name of the template into which the body content will be placed. The custom templates must have been already added to the platform for usage. To get a new template added contact either the customer success manager for the account, or the pure360 support team for more information
If omitted : Default is used
Please see EMAIL FACADE or SMS FACADE for more details
message_trackHtmlInd
"Y"
Indicates whethr to enable tracking of links within the html body, this will feedback these events into the platform one to one reports.
If omitted : Will default to "Y"
message_trackPlainInd
"Y"
Indicates whethr to enable tracking of links within the plain text body, this will feedback these events into the platform one 2 one reports.
If omitted : Will default to "N"

Writeable Variables : STORE / UPDATE (Required)

Name Example Description
toAddress_base64
"dGVzdEB0ZXN0LmNvbQ=="
The recommended method to send string data, base 64 encoded. This variable is the recipient email address or mobile number depending upon the contentType
toAddress
"test@pure360.com"
If you are unable to base 64 encode strings, use this variable as the recipient email address or mobile number depending upon the contentType
deliveryDtTm_base64
"MTIvMDkvMjAxNCAxMDoyMg=="
The recommended method to send string data, base 64 encoded. This variable is the datetime that this delivery will be sent out
deliveryDtTm
"12/09/2014 10:22"
If you are unable to base 64 encode strings, use this variable as the datetime that this delivery will be sent out

Writeable Variables : STORE / UPDATE (Optional)

Name Example Description
multipartInd (SMS Only)
"Y"
Indicates whether the SMS being sent is a single message or spread over multiple messages (exceeding 160 characters).
If omitted : Defaults to "N"
validateEmailExistsInd
"Y"
Indicates whether to validate the email address should be validated before sending.
If omitted : Will default to "N"
allowResetBounceInd
"Y"
Indicates whether to reset the recipient, if it is a hard bounced recipient.
If omitted : Will default to "N"
allowResetOptoutInd
"Y"
Indicates whether to opt this recipient back in to the profile, ensure proof is kept of request to opt back in (if non transactional).
If omitted : Will default to "N"
customData
array(
  "firstName"=>"bob"
  )
An array of custom data to merge into the designated custom fields within the message.
If omitted : Will default to default personalisation or {~customFieldName~}
customFromDesc
"Marketing"
The text to display in the from description of the email.
If omitted : Will use the profile specific from descriptor
attachmentName
"Marketing"
Name of the attachment to add to the one to one send (a reference name - not the path)
attachment
[BASE64 STRING]"
The file itself encoded as a base64 string

Read-Only Variables : CREATE / LOAD / RELOAD

Name Example Description
contentBeanId
"2cb84accd39f79ac67048b07c4119862"
Bean id of the message (email or sms) passed as the processData during the CREATE of the bean, message is loaded in to the bean store
defaultAutoResponderEnabledInd
"Y"
Indicator as to whether the delivery is using the default auto-responder
createdDtTm
"06/09/2014 05:25"
Date/time (in string format) that the delivery entity was created
createdBy
"test.sys"
User name of the login that created the one2one delivery.
deliveryId
659874
Unique identifier for this delivery.
deliveryReportId
454578
The id of the delivery report record that links to the tracking data.
automationId
898742
The ID of the automation that generated the one2one delivery entity