Replying to Messages with WhatsApp

Using SmartFlows to reply to a WhatsApp Session Messages can occur one of two ways:

  • Synchronous Message Replies
  • Asynchronous Replies

Synchronous Message Replies

Synchronous replies are single or multiple message replies to WhatsApp Session Messages that contain the WhatsApp Inbound Message trigger. Messages of these type include message receipt acknowledgments (eg. “we got your message”), automated responses (e.g. automated bot-based messaging), or generally any message that does not involve an agent or third-party system involvement.

Asynchronous Replies

Asynchronous replies are replies to WhatsApp session messages that require that the message be sent to an external system (ACD, CRM, workflow automation, etc.) outside of Atmosphere® SmartFlows before another system for processing

Sending Replies

How you send the reply will depend on the type of reply you will be using.

For Synchronous Message Replies:

Synchronous message replies are the easiest types of replies to configure.

To configure:

  1. Add a WhatsApp Send action to your Atmosphere® SmartFlow.

  1. Click on the WhatsApp Send action.
  2. Select the appropriate Message Type (Text or Image).
  3. Complete the configuration of the message. For more information, check out WhatsApp Send.
  4. The App Id and App User Id are not required. The WhatsApp Send action will gather that information from the Inbound WhatsApp message trigger.

For Asynchronous Message Replies:

Sending Asynchronous Message Replies are a little more complicated. They will require multiple Atmosphere® SmartFlows to complete the process, a message receiving flow and a reply message flow.

The Message Receiving Flow

The message receiving flow contains the Inbound WhatsApp Messaging trigger. At some point in the flow, you will need to send the message to a third-party system. This could be an agent chat application, a customer relationship management system, or even a call distribution system.

How the message is sent to the third-party system may vary. When the message is sent you will need to ensure that you send the following system variable information:

  • $IbWapp.messageText: The message that was received.
  • $IbWapp.appId: Identifies which WhatsApp number received the message.
  • $IbWapp.appUserId: Identifies the conversation you are replying to.

If you are using the External Web Call action to send the message to the third-party system, you can find additional information on how to configure this action here.

The Reply Message Flow

Reply message flow will normally be executed via a call to the Atmosphere® SmartFlows API. For specifics on how to call SmartFlows via an API, check out Executing SmartFlows from an External Source.

To configure your flow:

  1. Within the Inbound API trigger, you will need to include the following variables in the Inputs section:
    • replyText or replyURL: The message or image you wish to reply with.
    • appId: Identifies which WhatsApp number received the message
    • appUserId: Identifies the conversation you are replying to.

  1. Next, you will add a WhatsApp Send to your Flow.

  1. Configure the WhatsApp Send Inputs based on the Message Type (Text or Image).
  2. Add any additional steps your business rules require.

  3. Save and Deploy your flow.

Your flow now has everything it needs to successfully reply. You can now test your replies from your external system.

For additional information, check out WhatsApp Send