Setting up social channels
Set up the conversational channels connections including Apple Business Chat,
WhatsApp, SMS, Facebook, and Twitter within the Digital Messaging Manager of your Digital
messaging interface to enable customers to interact with Pega Intelligent Virtual Assistant
(IVA) by sending messages from the respective messaging channels. By performing this task,
you ensure that users can quickly and efficiently request information or report problems
with your application through these conversational channels. Twilio generates a unique identifier when you create a Twilio
account. You cannot use your Facebook Admin account to authorize a Facebook
page for Digital Messaging in more than one Pega application at the same time,
but you can use a Facebook Admin account to add multiple Facebook pages to the
same application. When using Facebook, a Facebook page can have multiple Admins
Create a Facebook page for your Facebook application. For more information, see
the Facebook developer portal. Users see Get Started on the welcome screen in
Messenger. When the user clicks Get Started,
the Get Started message is posted in the
conversation, and the page is granted permission to send messages.
The above scenario applies when the user starts a conversation
directly on Facebook or follows a channel switch from Web Messaging to Facebook Messenger. Get
Startedis enabled for connected Facebook pages in the
Digital Messaging Managerwhen a user adds the page to its Web Messaging channel switch options. The Client Channel API provides you with a standardized method to exchange
messages between several types of third-party client channels, for example, Teams,
Webex, or Slack, and Digital Messaging
Service. The process of sending and receiving messages as JSON payload requests using the
Client Channel API consists of four stages: This endpoint is the Digital Messaging Webhook URL that
the system specifies in your Digital Messaging Manager and Client Channel
API settings, for example:
The
Digital Messaging Service
then forwards the message to your Pega Customer Service
application. Use the Client Channel API to securely communicate between your Pega Customer Service application, your integration layer,
and third-party client channels, for example, Teams, Webex, or Slack. As a result, you make
Digital Messaging more accessible by
engaging with your customers in their preferred social messaging channels. The Client
Channel API provides you with a Digital
Messaging Service endpoint to which you can send payload requests in JSON
format. The payload requests indicate an action during a chat conversation, for example,
when a customer in the client channel sends a message. Similarly, you can set up an endpoint
for your integration layer to receive payload requests from the Digital Messaging Service, for example, when the
chatbot or CSR sends a reply or is busy typing. Configure Digital Messaging channel
security settings, and create a Digital
Messaging channel if you do not have a channel interface for Digital Messaging. For more information, see
Enabling Digital Messaging. You must configure the webhook URL so that the URL is publicly
accessible (off VPN) to enable communication withDigital Messaging
Service. If your integration layer is behind a firewall or
otherwise limits access to internal-only users and components,
you must set up the webhook URL so that the URL is reachable
publicly. Ensure that the URL string starts with "https." On the Connections tab of your Digital Messaging interface, the system displays the Client
Channel API connection. After you configure a Client Channel API connection, users can send and receive
messages from a chatbot or an agent the same way that they do using other native
Digital Messaging channels. Use the guidelines in this section to help you design the best possible third-party
client channel integration with the Digital
Messaging channel. Consider the following best practices for your client channel integration with the Client
Channel API: To communicate between your Digital
Messaging channel and a third-party client channel for example, WebEx or
Teams, you use the Client Channel API by sending and receiving JSON data in a specific
payload format. As a result, your integration layer can interact with Digital Messaging Service and your third-party
client channel in the correct format, providing a seamless experience to the customer. You
can configure different payload types in the same API in your integration layer. To send and receive JSON requests between the integration layer and Digital Messaging Service, JSON payload
headers must include the following information: Your integration layer must generate an authorization token that you include in each
JSON request. Use the connection_id value as the JSON Web Token
(JWT) issuer and sign the JWT using the value for JWT Secret, as shown in the
following sample code: After you successfully add a Client Channel API connection in the Digital Messaging Manager, the system stores the
connection_id and JWT Secret values in your Client Channel API settings.
For more information, see Creating a client channel connection. To send request payloads from your integration layer to Digital Messaging Service,
invoke When a customer performs any of the following actions in the client channel, send a
request payload from your integration layer: The following is the JSON body format of the request payload for the
customer message that your integration layer sends to Digital Messaging
Service: The following table describes the parameters passed in the Customer message payload
request: The
attachment URL must be a valid downloadable value, for example,
The following table describes the parameters passed in the Typing indicator payload
request: The following table describes the parameters passed in the Customer ended the
conversation payload request: You receive a request payload in
your integration layer when the chatbot or CSR performs one of the following actions
in your Digital Messaging channel:
The following is the JSON body format of the request payload that your
integration layer receives from Digital Messaging Service when the chatbot or CSR sends a
message: The following table describes the parameters passed in the Text message payload
request: The following table describes the parameters passed in the Menu payload
request: The following table describes the parameters passed in
the Carousel payload request: The following table describes the parameters passed in the Link payload
request: The following table describes the parameters passed in the Typing indicator payload
request: The following is the JSON body format of the request payload that your
integration layer receives from Digital Messaging Service when the CSR
ends the conversation: The following table describes the parameters passed in the CSR ended the
conversation payload request: On successful delivery of a request payload from your integration layer to Digital
Messaging Service, the system returns a success response, 200:
Successful request, for example: In a case of failure, Digital Messaging Service returns one of the following response
errors:Setting up Apple Business Chat
Setting up WhatsApp
Setting up SMS
Setting up Facebook
Setting up Twitter
Client Channel API
https://incoming.artemis.pega.digital/messages
https://sampleclientchannelwebhook.com
. You
must configure the webhook URL so that the URL is publicly accessible (off VPN)
to enable communication with Digital
Messaging Service. If your integration layer is behind a firewall
or otherwise limits access to internal-only users and components, you must set
up the webhook URL so that the URL is reachable publicly.Supported message types
The system
supports the following features during communication from a client channel to the
Digital Messaging service:
The system supports the following features while communicating with the Digital Messaging service to a client channel: Creating a client channel connection
Client Channel API guidelines
Client Channel API payload requirements
Authorization
var jwt = require("jsonwebtoken")
const token = jwt.sign({iss: "connection_id"}, 'jwt_secret');
console.log(token);
Incoming payload format
POST {DIGITAL_MESSAGING_WEBHOOK}
with a JSON request body,
for example: POST
https://incoming.artemis.pega.digital/messages
Body (JSON)
{
"type": "text",
"customer_id": "string",
"customer_name": "string",
"message_id": "string",
"text": ["string"],
"postback": "string",
"attachments": [
{
"url": "string"
}
],
"context_data": {
"string": "string"
}
}
Parameter Description Type type The static value "text" Required customer_id The ID of the customer sending the message. The ID is a unique
value that is provided by the client channel. Required customer_name The name of the customer sending the message. Optional message_id The ID of the message. The ID is a unique value that is provided
by the client channel and must be different for every
message. Required text An array of strings that specify messages from the customer. See
also the note below. Optional postback The payload value of the menu or carousel item that is selected.
See also the note below. Optional attachments.[].url Temporary private URL that references a file attachment. See also
the note below. Optional context_data.key The context data key. Optional context_data.value The context data value. Optional https://samplesite.com/filename.pdf
. The system receives
message_id as the source_id and
uses the value as the pySourceID in your
application.Body (JSON)
{
"type": "typing_indicator",
"customer_id": "string",
}
Parameter Description Type type The static value "typing_indicator". Required customer_id The ID of the customer that is sending the message. The ID is a
unique value that is provided by the client channel. Required Body (JSON)
{
"type": "customer_end_session",
"customer_id": "string",
}
Parameter Description Type type The static value "customer_end_session". Required customer_id The ID of the customer that is sending the message. The ID is a
unique value that is provided by the client channel. Required Outgoing payload format
To receive request
payloads from Digital Messaging Service in
your integration layer, the system uses POST {CLIENT_WEBHOOK}
to send a
JSON request body, for example: POST
https://sampleclientchannelwebhook.com
Body (JSON)
{
"type": "text",
"customer_id": "string",
"message_id": "string",
"csr_name": "string",
"text": ["string"],
"attachments": [
{
"url": "string",
"content_type": "string",
"file_name": "string",
"size": numeric
}
]
}
Parameter Description type The static value "text". customer_id The ID of the customer to which the chatbot or CSR sends the
message. message_id The unique ID of the message. csr_name The name of the CSR that is sending the message. text An array of strings that correspond to the messages sent by
the chatbot or CSR. attachments.[].url A temporary private URL that references an attachment
file. attachments.[].content_type The content type for the file attachment. attachments.[].file_name The attachment file name. attachments.[].size The size in bytes of the file attachment Body (JSON)
{
"type": "menu",
"customer_id": "string",
"message_id": "string",
"csr_name": "string",
"title": "string",
"items": [
{
"text": "string",
"payload": "string",
"image_url": "string"
}
]
}
Parameter Description menu A static value "menu". customer_id The ID of the customer to which the chatbot or CSR sends the
message. message_id The unique ID of the message. csr_name The name of the CSR that is sending the message. title The title for the menu. items.[].text The label for the menu option. items.[].payload The postback value for the reply option. items.[].image_url The URL referencing an optional image for the reply
option. Body (JSON)
{
"type": "carousel",
"customer_id": "string",
"message_id": "string",
"csr_name": "string",
"items": [
{
"title": "string",
"sub_title": "string",
"title_image_url": "string",
"items": [
{
"text": "string",
"payload": "string",
"description": "string",
"image_url": "string"
}
]
}
]
}
Parameter Description type The static value "carousel". customer_id The ID of the customer to which the chatbot or
CSR sends the message. message_id The unique ID of the message csr_name The name of the CSR that is sending the
message. items.[].sub_title The optional subtitle for the menu. items.[].title_image_url The optional title image URL for the
menu. items.[].items[].text The label for the menu. items.[].items[].payload The postback value for the menu option. items.[].items[].description The optional description for the menu
option. items.[].items[].image_url The URL referencing the optional image for the
menu option. Body (JSON)
{
"type": "link_button",
"customer_id": "string",
"message_id": "string",
"csr_name": "string",
"title": "string",
"label": "string",
"url": "string"
}
}
Parameter Description type The static value "link_button". customer_id The ID of the customer to which the chatbot or CSR sends the
message. message_id The unique ID of the message csr_name The name of the CSR that is sending the message. title The title for the link button. label The label for the link button. url The URL that opens when a customer taps the button. Body (JSON)
{
"type": "typing_indicator",
"customer_id": "string",
}
Parameter Description type The static value "typing_indicator". customer_id The ID of the customer. Body (JSON)
{
"type": "csr_end_session",
"customer_id": "string",
}
Parameter Description type The static value "csr_end_session". customer_id The ID of the customer. Delivery confirmation
{
"account_id": "string",
"source_id": "string",
"source": "custom",
"date": "2022-07-08T14:51:01.589Z",
"visibility": "private",
"recipient_profile_id": "string",
"customer": {
"id": "string",
"profile_name": "string",
"profile_id": "string"
},
"consumer_id": "string",
"content": {
"text": "string"
},
"postback": "string",
"context_data": {
"string": "string"
}
}
Previous topic Private Data API for secure data transmission Next topic Configuring a chatbot