bus_facade_campaign_contentItem


**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 contentItem

[**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 creating an empty contentItem entity in the bean store 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 contentItem entities use the campaign contentItem entry point / gateway. * Perform a create process without any entity fields to generate the new contentItem entity bean. **Example Request / Response:**
paintRequest:
contextId   string  :   C-KFDsCMMHXpDUi0ltN0p3FvF
className   string  :   bus_facade_campaign_contentItem
processName string  :   create
entityData  array   :	 null
processData array   :	 null
paintResponse:
Result   array :   
      	 'result'     => "success"
		 'resultData' => array
						 'bus_entity_campaign_contentItem'  => array
                  		 ... => ...
						 ...  variables  ...
          				 ... => ...
						 'beanId' => ID for new empty contentItem 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](/documentation/soap/gettingstarted/references/context) * To access the contentItem entities use the campaign contentItem entry point/gateway * Perform an update process with the writeable parameters that make up the contentItem 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_contentItem
processName string  :   update
entityData  array   : 
			'clientReference_base64' => Name of the contentItem base 64 encoded
			'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_contentItem_key' => ""
             			 'messageId' => ""
            			 'beanName' => "bus_entity_campaign_contentItem"

**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](/documentation/soap/gettingstarted/references/context) * To access the contentItem entities use the campaign contentItem 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_contentItem
processName string  :   store
entityData  array   :   'beanId'  => ID of the entity bean in the bean store
processData array   : null
paintResponse:
Result   array : 'result' => "success"

bus_entity_campaign_contentItem

Writeable Variables : STORE / UPDATE (Required)

Name Example Description
clientReference_base64
"TG9uZG9u"
The recommended way to transfer string data is via base64 encoding. The unique reference that identifies this item of content base 64 encoded. The reference must be unique within the profile
contentHtml_base64
"PGgxPkhlYWRlcjwvaDE+PGJyIC8+RW1haWwgYWJvdXQgbG9uZG9uIQ=="
The recommended way to transfer string data is via base64 encoding. The Content to place in the HTML part of the contentItem
contentPlain_base64
"LS0tLS1IZWFkZXItLS0tLQ0KRW1haWwgYWJvdXQgbG9uZG9uIQ=="
The recommended way to transfer string data is via base64 encoding. The Content to place in the PLAIN TEXT part of the contentItem
clientReference
"London"
If there is no way to base 64 encode the string, then this variable can be used as the unique refrence that identifies this item of content. The reference must be unique within the profile
contentHtml
<h1>Header</h1><br />Email about London
If there is no way to base 64 encode the string, then use this variable to place content in the HTML part of the contentItem
contentPlain
<h1>Header</h1><br />Email about London
If there is no way to base 64 encode the string, then use this variable to place content in the PLAIN TEXT part of the contentItem

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
contentItemId
658745
Unique id for the content item, derived by the system during creation
identityId
12145
Profile ID this content item belongs to

bus_search_campaign_email

Writeable Variables : SEARCH

Name Example Description
clientReference
"London"
Searches for Content Item entity based on the clientReference

Read-Only Variables : SEARCH

Name Example Description
idData
array(
  "contentItemId"=>123456
  )
contentItemId returned from search process