bus_facade_campaign_sms


**Description :** Used in the management of SMS messages 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 an SMS message

[**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 sms 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 sms entities use the campaign sms entry point / gateway. * Perform a create process without any entity fields to generate the new sms entity bean. **Example Request / Response:**
paintRequest:
contextId   string  :   C-KFDsCMMHXpDUi0ltN0p3FvF
className   string  :   bus_facade_campaign_sms
processName string  :   create
entityData  array   :	 null
processData array   :	 null
paintResponse:
Result   array :   
         'result'     => "success"
		 'resultData' => array : 
		 				 'bus_entity_campaign_sms'=> array : 
                                                     ... => ...
													 ...  variables  ...
                                                     ... => ...
                                                     'beanId' => ID for new empty sms 
                                                                 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) - *link here* * To access the sms entities use the campaign sms entry point/gateway * Perform an update process with the writeable parameters that make up the sms 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_sms
processName string  :   update
entityData  array   : 
			'messageName_base64' => "U01TIERlYWxz"
		    '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_sms_key' => ""
            			 'messageId' => ""
                         'beanName'  => "bus_entity_campaign_sms"

**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) - *link here* * To access the sms entities use the campaign sms 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_sms
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_sms

Writeable Variables : STORE / UPDATE (Required)

Name Example Description
messageName_base64
"QVBSSUxfMjAxNF9TTVM="
The recommended method to send string data, base 64 encoded. This variable is the unique name of the SMS message within the profile
messageName
"APR_2014_sms"
If you are unable to base 64 encode strings, use this variable as the unique name of the message within the profile. This is not included in the message sent
bodySms_base64
"VGV4dCB0byB7fmZpcnN0X25hbWV+fQ=="
The recommended method to send string data, base 64 encoded. This variable is the content to place in the body part of the message
bodySms
"Text to {~first_name~}"
If you are unable to base 64 encode strings, use this variable as the content to place in the body part of the message

Writeable Variables : STORE / UPDATE (Optional)

Name Example Description
multipartInd
"Y"
Indicates whether this is a multipart SMS (i.e. one message over multiple SMS messages)
allowInvalidCustomFieldsInd
"Y"
Indicator as to whether custom fields are allowed in this sms that aren't in a list and therefore not valid in the system.
If omitted : will return an error when trying to store the message if the custom field doesn't already exist in the platform
fromAddress
"Marketing"
The text to display in the from description of the sms. These must have been already added to the platform for usage. When creating or loading an sms entity bean the full list is returned in an element of the bus_entity_campaign_sms object. To get a from address added contact either the customer success manager for the account, or the pure360 support team to discuss
If omitted : Default is used
languageCode
"en_GB.ISO8859-15"
Language code for this message, this is used primarily to warn the user if they are scheduling a message in a different character set to this list.
If omitted: Profile default language code used for this message.
templateName
"sms-msg-default"
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. When creating or loading an sms entity bean the full list is returned in an element of the bus_entity_campaign_sms object. The defaults is sms-msg-default. 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

Read-Only Variables : CREATE / LOAD / RELOAD

Name Example Description
amendedBy
"test.sys"
Username of the user that uploaded or amended the sms last, only populated in an existing sms
amendedDtTm
"24/02/2014"
"14:07:00"
The date time of the last amendment to this sms, only populated in an existing sms
listCustomFieldNames
array(
  "FirstName"=>"FirstName",
  "Age"=>"Age"
)
An array of the existing custom field names that have been created
listLanguages
array(
  "en_GB.ISO8859-15" => 
  "{!response.db.language.en_gb_iso8859_15!}"
);
Array of valid sms languages for this profile.
listTemplates
array(
   "sms-msg-default" => 
   "{!response.app.campaign_manager_messages.template_sms_1!}"
);
Array of valid sms templates for this profile. Please contact the customer success manager or support @pure360 to have these either added, changed or removed
messageId
12454
Unique id of this sms message within the platform, derived by the system when writing back the newly created sms to the platform

bus_search_campaign_sms

Writeable Variables : SEARCH

Name Example Description
amendedFromDate
"01/01/2013"
Searches for sms entities since date last amended
amendedToDate
"01/01/2014"
Searches for sms entities up to a date last amended
messageName
"April 2014 Deals"
Searches for sms entities based on the message name

Read-Only Variables : SEARCH

Name Example Description
idData
array(
  "messageId"=>123456,
  "messageId"=>234567
)
Array of messageIds returned from a search process