Pass Pre-Chat to Salesforce Messaging for In-App and Web REST API

Pass Pre-Chat to Salesforce Messaging for In-App and Web REST API

When we invoke the Salesforce Messaging for In-App and Web REST API, routingAttributes can be used to pass the Pre-Chat field values.

1. Setup the Salesforce Messaging for In-App and Web REST API configurations.

2. In the Omni-Channel Flow, create the Input variables.

3. In the Messaging Channel, map the Pre-Chat parameters to the Flow Input variables.

4. When you invoke the Salesforce Messaging for In-App and Web REST API to create the Conversation, pass the Pre-Chat field values using the routingAttributes.

5. You can use the following payload for your reference. When we pass the routingAttributes, make use of the Channel Variable Name. If you use incorrect values, you will get error or exception.

Sample Payload:

{
    "conversationId": "1b6cdca4-5532-436c-aec8-33cb213986c2",
    "esDeveloperName": "MIAW_REST_API", 
    "routingAttributes": {  
        "_firstName": "Test",
        "_lastName": "Contact",
        "_email": "test@test.com"
    }
}

Output:

Leave a Reply