1.0.0
Create send definitions for WhatsApp messages. A send definition stores the settings that stay the same from one send to the next: the sender, the content, and any message purpose and communication subscription. Creating a send definition doesn't send a message.
After you create the send definition, pass its ID in the sendDefinitionId query parameter when you send with WhatsApp - Send (Direct Send API).
Create send definitions on your org's My Domain host. Send messages through the Salesforce API gateway at api.salesforce.com.
This table lists the use cases that the API supports.
| Supported Use Case | HTTP Verb | URI |
|---|---|---|
| Create a WhatsApp send definition | POST | /services/data/{apiVersion}/connect/e360/whatsapp/sendDefinition |
Before You Begin
- A Salesforce access token whose user can create send definitions. With the client credentials flow, that's the Run As user on the External Client App.
- The sender: the record ID of an active WhatsApp Messaging Channel.
- The content key of the published CMS content, if you're linking content. The content must be
sfdc_cms__whatsappTemplate(recommended) orsfdc_cms__whatsappSessioncontent. - The name of the communication subscription, if your content needs one. See Communication Subscriptions.
Communication Subscriptions
Whether a WhatsApp send definition needs a communication subscription depends on the linked content.
| Content | Subscription Behavior |
|---|---|
| Session | No subscription is required. Omit messagePurpose and communicationSubscription. |
| Marketing template | If you omit communicationSubscription, the API uses the configured Marketing subscription. |
| Utility or authentication template | Pass the name of a subscription that's configured for the sender. |
Send Definition IDs
WhatsApp send definition IDs start with 539.
Rules for All Channels
Some send definition rules are the same for every channel: how message purpose and communication subscriptions work, how data spaces relate to business units, which identifier to pass in each field, and how to name send definitions. For more information, see Send Transactional Messages Through Direct Send API.
Errors
When a request fails, the response body is an array of error objects. Each object contains a message that describes the error.
Salesforce Marketing Cloud
Let us know so we can improve!