bus_facade_campaign_dynamicRegion


**Description :** Used in the management of dynamic content items 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)

Example Process - Creating a Dynamic Region

[**WSDL**](http://paint.pure360.com/paint.pure360.com/ctrlPaint.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 searching for the message Id of the message that will be the parent of our dynamic region... * Use the contextId to reference the current session in progress (generated during a login request - [bus_facade_context](/documentation/soap/gettingstarted/references/context) ) * To access the message entities use the campaign message entry point / gateway * Perform a search process with the entity field "messageName" populated with the target message name to return the messageId for that message. **Example Request / Response:**
paintRequest:
contextId   string : C-KFDsCMMHXpDUi0ltN0p3FvF
className   string : bus_facade_campaign_message
processName string : search
entityData  array  : 'messageName' => "Local news in {~location~}"
processData array  : null
paintResponse:
Result   array :
         'result'     => "success"
         'resultData' => array : 
         				 'bus_search_campaign_message' => ""
         				 ...      => ...
         				 'idData' => array : 
         				             'messageId' => 123456

**Step 2:** Next, load the email entity into the bean store, as a dynamic region is being added this will need to be altered... * Use the contextId to reference the current session in progress (generated during a login request - [bus_facade_context](/documentation/soap/gettingstarted/references/context) ) * To access the email entities use the campaign email entry point / gateway * Perform a load process with the entity field "messageId" populated with the returned messageId from the search entity. **Example Request / Response:**
paintRequest:
contextId   string : C-KFDsCMMHXpDUi0ltN0p3FvF
className   string : bus_facade_campaign_email
processName string : load
entityData  array  : 'messageId' =>  ID returned from the search entity 
processData array  : null
paintResponse:
Result   array	: 	
		 'result'     => "success"
		 'resultData' => array : 
                         ‘bus_entity_campaign_email  => array:
					                                          ... => ...
                                                              ... All entity variables ...
					                                          ... => ...
					                                          'beanId' => ID of loaded email entity bean
                                                                           in the bean store

**Step 3:** Next create an empty dynamic region entity in the bean store, with the parent email entity bean id and obtain a reference to this... * Use the contextId to reference the current session in progress (generated during a login request - [bus_facade_context](/documentation/soap/gettingstarted/references/context) * To access the dynamicRegion entities use the campaign dynamicRegion entry point / gateway. * Perform a create process without any entity fields to generate the new dynamicRegion bean in the parent entity bean. **Example Request / Response:**
paintRequest:
contextId	string	: 	C-KFDsCMMHXpDUi0ltN0p3FvF
className 	string	: 	bus_facade_campaign_dynamicRegion
processName string	: 	create
entityData 	array	:   null
processData array	:   'parentBeanId' => Email entity bean id of bean in bean store
paintResponse:
Result   array	: 	
		 'result'     => "success"
		 'resultData' => array : 
                         ‘bus_entity_campaign_DynamicRegion  => array:
					                                                    ... => ...
                                                                        ... All entity variables ...
					                                                    ... => ...
					                                                    'beanId' => ID for new empty automation 
                                                                                    bean in bean store

**Step 4:** 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) - context facade * To access the dynamicRegion entities use the campaign dynamicRegion entry point / gateway. * Perform an update process with the writeable parameters that make up the dynamicRegion creation process, the bean id of the new bean entity in the bean store returned from the create request, the emailId (messageId used earlier for the load), plus any optional parameters. **Example Request / Response**
paintRequest:
contextId	string	: 	C-KFDsCMMHXpDUi0ltN0p3FvF
className 	string	: 	bus_facade_campaign_dynamicRegion
processName string	: 	update
entityData 	array	:	'regionName_base64' => "bG9jYXRpb24="
								'emailId'		    	=> Id used earlier for the load process 
								                       	(identity of the email this region links to)
								'fieldName'      		=> "homeTown"
								'beanId'            => ID of the empty bean returned during the create
							    ... => ...
                                ... Required & optional writable variables...
							    ... => ...
processData array		: 	null
paintResponse:
Result   array :
		 'result' => "success"

Step 5 : Next 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) - context facade * To access the dynamicRegion entities use the campaign dynamicRegion 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_dynamicRegion
processName string	: 	store
entityData 	array	:	'beanId' 	=> ID of the entity bean in the bean store
processData array	:	null
paintResponse:
Result   array :
		 'result'     => "success"
         'resultData' => array :
					     'bus_entity_campaign_dynamicREgion_key' => ""
						 'regionId' => ""
						 'beanName' => "bus_entity_campaign_dynamicRegion"

bus_entity_campaign_dynamicRegion

Writeable Variables : CREATE (Required)

Name Example Description
parentBeanId
"eee79849832b0bbf889380f6bc3f417d "
The id of the email entity bean loaded into the bean store that is the parent of this dynamic region

Writeable Variables : STORE / UPDATE (Required)

Name Example Description
emailId
1145423
Unique identity of the email that this dynamic region is linked to. This is the id used to load the parent bean in to the bean store.
fieldName_base64
"Q291bnRyeQ=="
The recommended way to send string data base 64 encoded. This variable Name of the custom field within the delivery list that this region will interrogate to establish which content items are required for the recipient.
fieldName
"Country"
If you are unable to base 64 encode the string then use this variable as the name of the custom field within the delivery list that this region will interrogate to establish which content items are required for the recipient.
regionName_base64
"TG9jYXRpb24="
The recommended way to send string data base 64 encoded. This variable is the name given to uniquely identify this region within this email.
regionName
"Location"
If you are unable to base 64 encode the string then use this variable as the name given to uniquely identify this region within this email.

Writeable Variables : STORE / UPDATE (Optional)

Name Example Description
footerHtml_base64
"PGgzPkFib3ZlIGNvbnRlbnQgc2VsZWN0ZWQgYmFzZWQgb24gY291bnRyeTwvaDM+"
The recommended way to send string data base 64 encoded. This variable is the HTML content that will follow the selection of HTML content items within this region.
footerPlain_base64
"LS0tLUFib3ZlIGNvbnRlbnQgc2VsZWN0ZWQgYmFzZWQgb24gY291bnRyeS0tLS0="
The recommended way to send string data base 64 encoded. This variable is the PLAIN TEXT content that will follow the selection of PLAIN TEXT content items within this region.
footerHtml
<h3>Above content selected based on country</h3>
If you are unable to base 64 encode the string then use this variable as the HTML content that will follow the selection of HTML content items within this region.
footerPlain
"---Above content selected based on country----"
If you are unable to base 64 encode the string then use this variable as the PLAIN TEXT content that will follow the selection of PLAIN TEXT content items within this region.
glueHtml_base64
"PGhyIC8+IE5leHQuLi4gPGhyIC8+"
The recommended way to send string data base 64 encoded. This variable is the HTML content that will be placed between multiple HTML content items if required within this region
gluePlain_base64
"LS0tLSBOZXh0IC0tLS0tIA=="
The recommended way to send string data base 64 encoded. This variable is the PLAIN TEXT content that will be placed between multiple PLAIN TEXT content items if required within this region
glueHtml
<hr /> Next .... <hr />
If you are unable to base 64 encode the string then use this variable as the HTML content that will be placed between multiple HTML content items if required within this region
gluePlain
"------ Next .... -------"
If you are unable to base 64 encode the string then use this variable as the PLAIN TEXT content that will be placed between multiple PLAIN TEXT content items if required within this region
headerHtml_base64
"PGgzPkJlbG93IGNvbnRlbnQgc2VsZWN0ZWQgYmFzZWQgb24gY291bnRyeTwvaDM+"
The recommended way to send string data base 64 encoded. This variable is the HTML content that will precede the selection of HTML content items within this region.
headerPlain_base64
"LS0tQmVsb3cgY29udGVudCBzZWxlY3RlZCBiYXNlZCBvbiBjb3VudHJ5LS0tLQ==="
The recommended way to send string data base 64 encoded. This variable is the PLAIN TEXT content that will precede the selection of PLAIN TEXT content items within this region.
headerHtml
<h3>Below content selected based on country</h3>
If you are unable to base 64 encode the string then use this variable as the HTML content that will precede the selection of HTML content items within this region.
headerPlain
"---Below content selected based on country----"
If you are unable to base 64 encode the string then use this variable as the PLAIN TEXT content that will precede the selection of PLAIN TEXT content items within this region.
hideIfBlankInd
"N"
Indicator as to whether the entire region should be hidden if there are no content items to display for this region, or if negative (N) then a default content item should be inserted.
defaultContentItemRef_base64
"default-local"
The recommended way to send string data base 64 encoded. This variable is the client reference that points to a content item to be displayed if the recipient has no other valid content items for this region. That is, if the custom field for the recipient is blank or does not contain any valid content items.
defaultContentItemRef
"default-local"
If you are unable to base 64 encode the string then use this variable as the client reference that points to a content item to be displayed if the recipient has no other valid content items for this region. That is, if the custom field for the recipient is blank or does not contain any valid content items.

Read-Only Variables : CREATE / LOAD / RELOAD

Name Example Description
amendedBy
"test.sys"
Username of the user that uploaded or amended the email last, only populated in an existing email
amendedDtTm
"24/02/2014 14:07:00"
The date time of the last amendment to this email, only populated in an existing email
emailDynamicRegionId
78457
Unique identifier for this region

bus_search_campaign_dynamicRegion

Writeable Variables : SEARCH

Name Example Description
emailId
121545
Unique id of the email parent of the dynamic regions to search, will return all regionIds associated with that email

Read-Only Variables : SEARCH

Name Example Description
idData
array(
  regionId=>123456,
  regionId=>234567
)
Array of regionIds returned from a search process belonging to the email given by emailId