From a6715b750210cacbda0afe923a5dac6ddcccf2a1 Mon Sep 17 00:00:00 2001 From: Funke Olasupo Date: Thu, 18 Jan 2024 16:31:52 +0000 Subject: [PATCH] GITBOOK-1229: update WhatsApp Integration --- SUMMARY.md | 2 +- .../whatsapp-omnichannel-integration-api.md | 39 +++++++++++++++ reference/api/rest-api/endpoints/README.md | 2 +- .../whatsapp-endpoints/README.md | 7 ++- .../whatsapp-omnichannel-integration-api.md | 49 ------------------- 5 files changed, 44 insertions(+), 55 deletions(-) create mode 100644 omnichannel/whatsapp-omnichannel-integration-api.md delete mode 100644 reference/api/rest-api/endpoints/miscellaneous/whatsapp-endpoints/whatsapp-omnichannel-integration-api.md diff --git a/SUMMARY.md b/SUMMARY.md index a1e67626..e7e1539b 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -139,6 +139,7 @@ * [Channel Apps](omnichannel/developing-omnichannel-apps/channel-apps.md) * [Chatbots](omnichannel/developing-omnichannel-apps/chatbots.md) * [CRM Apps](omnichannel/developing-omnichannel-apps/crm-apps.md) +* [WhatsApp Business Omnichannel Integration](omnichannel/whatsapp-omnichannel-integration-api.md) ## Bots @@ -732,7 +733,6 @@ * [Confirm Enterprise License](reference/api/rest-api/endpoints/miscellaneous/licenses/confirm-enterprise-license.md) * [Get Maximum Active User](reference/api/rest-api/endpoints/miscellaneous/licenses/get-maximum-active-user.md) * [WhatsApp Endpoints](reference/api/rest-api/endpoints/miscellaneous/whatsapp-endpoints/README.md) - * [WhatsApp omnichannel integration API](reference/api/rest-api/endpoints/miscellaneous/whatsapp-endpoints/whatsapp-omnichannel-integration-api.md) * [Send a Template WhatsApp Message](reference/api/rest-api/endpoints/miscellaneous/whatsapp-endpoints/send-a-template-whatsapp-message.md) * [Video Conference Endpoints](reference/api/rest-api/endpoints/miscellaneous/video-conference-endpoints/README.md) * [Update Jitsi Timeout](reference/api/rest-api/endpoints/miscellaneous/video-conference-endpoints/jitsi-update-timeout.md) diff --git a/omnichannel/whatsapp-omnichannel-integration-api.md b/omnichannel/whatsapp-omnichannel-integration-api.md new file mode 100644 index 00000000..54445d1d --- /dev/null +++ b/omnichannel/whatsapp-omnichannel-integration-api.md @@ -0,0 +1,39 @@ +--- +description: WhatsApp Business Integration for Rocket.Chat +--- + +# WhatsApp Business Omnichannel Integration + +Integrating Whatsapp business in your Rocket.Chat workspace offers valuable enhancements to simplify your business communication workflows. The [Whatsapp business integration](https://docs.rocket.chat/extend-rocket.chat-capabilities/rocket.chat-marketplace/rocket.chat-public-apps-guides/omnichannel-apps/whatsapp-cloud-app) allows you to send template messages to a targeted user. + +You can send a Whatsapp template message from your workspace via the following methods: + +1. **Sending template messages via endpoints**: Refer to the [Send a Template WhatsApp Message](../reference/api/rest-api/endpoints/miscellaneous/whatsapp-endpoints/send-a-template-whatsapp-message.md) API endpoint. +2. **Slash commands and UI**: Send the template message in a more user-friendly way using the GUI form. To trigger the GUI, open a WhatsApp contact room and run the `/whatsapp send-template`command. This command opens up a modal where you can select the following: + +* The `Template` you wish to send, +* The `Language` you wish to send the template in, +* And also substitute `parameters` within the message, if present + +{% hint style="info" %} +If parameters are present within the template message, kindly ensure you substitute all of them before sending the message. Failure to do so will result in an error. +{% endhint %} + +**Getting the status of messages sent** + +To receive real-time status updates for outbound messages, navigate to the **Settings** tab of the Whatsapp App and set the _**Message Status Endpoint URL**_. The app sends a request to this URL each time your message status changes to one of the following: **queued**, **failed**, **sent**, **delivered**, **read**, or if some error occurs. + +The table below highlights the payload format you will receive on the endpoint. + +| **Field Name** | **Type** | **Description** | +| :-----------------: | :------------------------------------------------------: | :------------------------------------------------------------------------: | +| msId | String or undefined | Message Id. | +| message | String | Text message | +| mobileNo | String | Phone number of WhatsApp user to which you had sent the message | +| connectedWhatsAppNo | String | Your connected WhatsApp Number from which you had sent the message to user | +| MessageStatus | String | Status of message - sent, delivered, read, failed, deleted | +| ErrorDetails |

Optional
Type: String or WhatsApp error format

| Errors from template messages will be shown here | +| type | String | `Template-Message` or `Regular-Message` | +| timestamp | String | Timestamp of request | + +In conclusion, the ability to send template messages through WhatsApp Business Integration enables businesses to maintain a consistent and professional communication approach with their audience. diff --git a/reference/api/rest-api/endpoints/README.md b/reference/api/rest-api/endpoints/README.md index c92d4b21..206d7bbe 100644 --- a/reference/api/rest-api/endpoints/README.md +++ b/reference/api/rest-api/endpoints/README.md @@ -863,7 +863,7 @@ You can get and update the settings via the REST API, only if you have permissio ### WhatsApp -
DescriptionDetails Page
WhatsApp Business API integration for Rocket.ChatLink
Send a template message.Link
+
DescriptionDetails Page
WhatsApp Business API integration for Rocket.ChatLink
Send a template message.Link
### Mailer diff --git a/reference/api/rest-api/endpoints/miscellaneous/whatsapp-endpoints/README.md b/reference/api/rest-api/endpoints/miscellaneous/whatsapp-endpoints/README.md index ba2b39ec..8f6ac884 100644 --- a/reference/api/rest-api/endpoints/miscellaneous/whatsapp-endpoints/README.md +++ b/reference/api/rest-api/endpoints/miscellaneous/whatsapp-endpoints/README.md @@ -2,7 +2,6 @@ ## WhatsApp -| Short Description | Details Page | -| ------------------------------------------------- | ----------------------------------------------- | -| WhatsApp Business API integration for Rocket.Chat | [Link](whatsapp-omnichannel-integration-api.md) | -| Send a template message. | [Link](send-a-template-whatsapp-message.md) | +| Short Description | Details Page | +| ------------------------ | ------------------------------------------- | +| Send a template message. | [Link](send-a-template-whatsapp-message.md) | diff --git a/reference/api/rest-api/endpoints/miscellaneous/whatsapp-endpoints/whatsapp-omnichannel-integration-api.md b/reference/api/rest-api/endpoints/miscellaneous/whatsapp-endpoints/whatsapp-omnichannel-integration-api.md deleted file mode 100644 index 7b097a28..00000000 --- a/reference/api/rest-api/endpoints/miscellaneous/whatsapp-endpoints/whatsapp-omnichannel-integration-api.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -description: WhatsApp Business API Integration for Rocket.Chat ---- - -# WhatsApp omnichannel integration API - -## Getting started with Template messages - -The WhatsApp app allows you to send template messages to a target user. - -In order to send a template message, you have two options: - -### 1. Via endpoint - -* REST API Documentation for this endpoint can be found [here](https://developer.rocket.chat/api/rest-api/methods/apps-endpoints/whatsapp-endpoints/template-message) - -### 2. Via Slash Command and UI - -* You can send the template message in a more user-friendly way using the GUI form. -* To trigger the GUI, open a WhatsApp contact room and run the following command - - > `/whatsapp send-template` -* This will open up a modal, where you can select - * The `Template` you wish to send, - * The `Language` you wish to send the template in, - * And also substitute `parameters` within the message, if present. - - > Note, If parameters (i.e eg ) are present withing the template message, please make sure that you substitute all of them before sending the message. Failure to do so will result in an error. - -A video demonstration of the above feature is available here: [![Watch the video](https://img.youtube.com/vi/TMNZ8HjGx-M/maxresdefault.jpg)](https://youtu.be/TMNZ8HjGx-M) - -## Getting status of messages sent - -To receive real-time status updates for outbound messages, you can choose to set a _Message Status Endpoint URL_. The app will send a request to this URL each time your message status changes to one of the following: queued, failed, sent, delivered, read, or if some error occurs. - -You can set the _Message Status Endpoint URL_ in the Apps Settings. - -Following is the payload format you will receive on the endpoint - -| **Field Name** | **Type** | **Description** | -| :-----------------: | :------------------------------------------------------: | :------------------------------------------------------------------------: | -| msId | String or undefined | Message Id. | -| message | String | Text message | -| mobileNo | String | Phone number of WhatsApp user to which you had sent the message | -| connectedWhatsAppNo | String | Your connected WhatsApp Number from which you had sent the message to user | -| MessageStatus | String | Status of message - sent, delivered, read, failed, deleted | -| ErrorDetails |

Optional
Type: String or WhatsApp error format

| Errors from template messages will be shown here | -| type | String | `Template-Message` or `Regular-Message` | -| timestamp | String | Timestamp of request |