The auto-response API allows you to pass parameters to Salesforce so that you can provide additional data to the auto-response messaging component when showing the user a web page such as a survey. To learn about and set up auto-response components, see Create a Messaging Component: Auto-Response (can be unavailable during release preview).
- Before you initialize the API, add an event listener for
onEmbeddedMessagingReady. This method notifies you when the API is ready for requests.
- After the
onEmbeddedMessagingReadyevent is dispatched, add or remove any items to the list of auto-response parameters. Use the
setAutoResponseParametersmethod to add a parameter. You can also use
removeAutoResponseParametersto remove a parameter value.
This sample code illustrates how you can implement the key steps of this sequence.
The Messaging for Web reference documentation describes these methods in more detail.