PostMessageToNumber
Initiates the sending of a message to one or more mobile numbers in Salesforce Marketing Cloud. This procedure supports direct, one-to-one or one-to-many mobile communications for marketing or transactional purposes.
Subscribers
The columns available for the Subscribers temporary table are the following:
| Column | Description |
| MobileNumber | Specifies the mobile number used as the unique identifier for that record. |
| SubscriberKey | Specifies the SubscriberKey value used as the unique identifier for that record. |
| Attributes | Set real-time attributes for individual personalization strings, per subscriber. The subscriber attribute must match the attribute string in the message. You can pass attributes that are not used as attributes in the message into the SMS send log. |
Execute
Use mobile numbers for referecing contact records:
EXECUTE PostMessageToNumber MessageId = 'NCNSDNsd222as85dj92j2sM', mobileNumbers = '[" +
" \"13175551212\"" +
" ]', Subscribe = true, Resubscribe = true, keyword = 'JOINSMS', Override = true, messageText = 'Welcome to Code@', ContentURL = 'http://image.exct.net/lib/abcd/m/1/dj_CC_AUS.jpg', SendTime = '2012-10-05 20:01'
Use Subscribers#TEMP table as an alternate way for referecing contact records:
INSERT INTO Subscribers#TEMP (MobileNumber, SubscriberKey, Attributes) VALUES ('15555554410', 'ExampleSubKey1', '{" +
" \"FirstName\":\"Michael\"" +
" }')
INSERT INTO Subscribers#TEMP (MobileNumber, SubscriberKey, Attributes) VALUES ('15555552254', 'ExampleSubKey2', '{" +
" \"FirstName\":\"Kristen\"" +
" }')
EXECUTE PostMessageToNumber MessageId = 'NCNSDNsd222as85dj92j2sM', Subscribe = true, Resubscribe = true, Keyword = 'JOINSMS', Override = false, SendTime = '2012-10-05 20:01'
Input
| Name | Type | Required | Description |
| MessageId | String | True | Specifies the encoded identifier (Id) of the outbound message definition. This Id is required to route the send request to the appropriate MobileConnect message configuration. |
| MobileNumbers | String | False | Specifies an array that contains one or more mobile numbers that should receive the message. Each number must be in a valid format supported by the carrier. |
| Subscribe | Boolean | False | Specifies whether Salesforce Marketing Cloud should create a subscription for the mobile number when none exists. A value of 'true' creates a new subscription that aligns with the message's short code and keyword. |
| Resubscribe | Boolean | False | Specifies whether Salesforce Marketing Cloud should reinstate a subscription for the mobile number if it is currently unsubscribed. A value of 'true' reactivates the subscription so that the contact can receive messages again. |
| Keyword | String | False | Specifies the keyword associated with the short code that applies to the outbound message. This parameter is required when Subscribe or Resubscribe is set to 'true' because the subscription workflow must map to the appropriate keyword. |
| Override | Boolean | False | Specifies whether the provided MessageText value should override the message text that is stored with the message definition. A value of 'true' applies the override. |
| MessageText | String | False | Specifies the message text that replaces the text stored with the outbound message definition. This value is required when the Override input is set to 'true'. |
| UtcOffset | String | False | Specifies the offset from Coordinated Universal Time (UTC) that applies to the blackout window start and end times. This value is required in every request to ensure that blackout restrictions are evaluated correctly. |
| WindowStart | String | False | Specifies the start time of the blackout window in the time zone that is determined by the UtcOffset parameter. To determine whether the SendTime input falls within the blackout period, convert the start and end times to UTC before comparing them to the scheduled delivery time. |
| WindowEnd | String | False | Specifies the end time of the blackout window in the time zone that is determined by the UtcOffset parameter. To determine whether the SendTime input falls within the blackout period, convert the start and end times to UTC before comparing them to the scheduled delivery time. |
| SendTime | Date | False | Specifies the UTC date and time when the message should be delivered. If the value represents a time in the past, the system sends the message immediately. Blackout window rules still apply when a blackout configuration exists. |
| ContentURL | String | False | Specifies the URL of the media content to be sent with an Multimedia Messaging Service (MMS) message. Carriers retrieve this content when processing the outbound request. |
Result Set Columns
| Name | Type | Description |
| TokenId | String | Specifies the token Id that is returned after the request is submitted. This Id can be used in a subsequent API call to check the processing status of the send. |