Description:
You can create message bucket record in Salesforce Marketing Cloud by using the below options.
1. Create a simple journey with one activity. Drag and drop the “Object Activity” from the activity list onto the canvas.
2. Start configuring the ‘Object Activity’ by clicking on it. In the ‘Select Object’ step, search for the object ‘Message Bucket’ and select.
3. Through this activity, you are just trying to ‘create’ a ‘Message Bucket’ record in Sales cloud. Here choose, ‘Create New’ as the action.
4. In the ‘Map Fields’ step, select the fields that need to be mapped to create a Message Bucket record. Here it displays all the available fields in ‘Message Bucket’ object.
5. Select ‘Number (To Phone)’ field. This is the message recipient phone number. From the right side menu, you can then simply select the phone number field from the Journey data extension. (In this example, the data extension field for phone number is Mobile_Phone__c).
6. Similarly select the ‘Account’ field in Message Bucket and map it to the corresponding field in the data extension.
7. Repeat the mapping until all of these fields are mapped. All the six fields need to be mapped.
8. You’d have this single step journey created. The data extension should contain the target customer records with all the fields required for the mapping.
Notes:
Using Salesforce Bulk API 2.0 with custom SSJS scripts in Automation Studio, you’ll be making API calls to Salesforce to insert Message Bucket records.
Notes
a. Bulk API 2.0 request can send upto 150,000,000 records (150 Million) in a 24-hour period with Max data size of 150MB per request.
b. Process up to 10k records in a batch. This will be 1 API call.
c. This does consume API calls outside of the Connector based Connected App Authentication.
d. For one million updates it would be just 100 calls ( and additional couple of calls for authentication and opening/closing of batch job).
Bulk API Flow
Currently custom activity calls external vendor WhatsApp API.
The custom activity can be updated to change the API call to Salesforce endpoint instead.
Using Salesforce BULK/REST API, a Message Bucket record can be created in Salesforce by simply calling the Salesforce endpoint.
Salesforce provides REST API to create a record in Salesforce.
Salesforce REST Endpoint URL
https://MyDomainName.my.salesforce.com/services/data/v59.0/sobjects/Message_Bucket__c/
Request to create Message Bucket record in Salesforce
{
“Sender_ID__c” : “XXXXX”
” Number (To Phone)” : “XXXXX”
” Related_To__c ” : “002XXXXXXX “
” Requested_Channel __c ” : “WhatsApp”
” Account” : “002XXXXXXX”
” Template_ID__c ” : “T0012”
}
Response
{
“id” : “001D000000IqhXXXXX”,
“errors” : [ ],
“success” : true
}
Amend the current custom activity to obtain the Template ID and store in a Data extension. Slightly complex.
Then using the “Object Activity” to create “Message Bucket” record creation (similar to Option 1)