From Bright Pattern Documentation
< 5.8:Mobile-SDK-Instruction-Manual
Revision as of 04:13, 29 May 2024 by BpDeeplTranslateMaintenance (talk | contribs) (Updated via BpDeleteTranslateTags script)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
• 5.19 • 5.8

Mobile/Web Messaging API v2 General Information

The Bright Pattern Mobile SDK simplifies the use of the Bright Pattern Mobile/Web Messaging API v2, which supports chat, voice, and video communications across a variety of channels (e.g., web chat, SMS, messenger services). The following is a list of methods available for this API; for complete API information, see the documentation on Postman.

Pre-Interaction Methods

The following methods are meant to be invoked before initiating an interaction.

Check Availability (GET)

This method indicates whether the associated scenario entry is available or not; it may provide EWT also.

Get ICE Servers (GET)

This method returns a list of configured ICE servers to provide to the browser so that an audio-visual session could be added to the chat.

Get Chat Widget Configuration (GET)

This method returns the chat widget configuration for the launch point.

Get Version (GET)

This method returns the Bright Pattern Contact Center software version of the server, which may be used for informational purposes.

Interaction-Related Methods

The following methods are meant to initiate interactions or provide information about existing interactions.

Request Chat (POST)

This method initiates a new chat session or returns the parameters of an existing session. This method must be invoked first.

Mobile Notification Subscription (POST)

This method is a client application request for either subscribing to or canceling mobile notifications for a chat session.

Expected Parameters (GET)

This method returns the expected parameters of the associated scenario entry.

Get Active Chat (GET)

This method returns the properties of an active chat session.

Send Events (POST)

This method sends an array of new chat events from the client to the server-side.

Get Chat History (GET)

This method returns all client events and all server events for the current session; multiple event objects can be returned.

Get New Chat Events (GET)

This method returns new chat events for the current session.

Upload File (POST)

This method uploads a specified file to the server.

Get File (GET)

This method downloads a specified file from the server using the received file ID.

Get Agent Profile Photo (GET)

This method downloads a profile photo of the specified agent.

Get Case History (GET)

This method returns the combined transcripts of all chat sessions (i.e., the chat thread) linked to the specific CRM case object.

Close Case (POST)

This method invokes a client application request to close the case associated with the chat session.

Events

The Mobile/Web Messaging API v2 includes a variety of client and server events; these events pass specific information about interactions. Additionally, signaling-message-type events are included for WebRTC-based (i.e., browser-based call or video) interactions.

For more information, please see the Bright Pattern Mobile/Web Messaging API v2 documentation on Postman.

API Usage Notes

When developing your application, please note the following.

General

  • A client application can only have one active communication session at a time.

Pre-Interaction Methods

  • The Check Availability method may be invoked before the Request Chat method. This method neither initiates nor discovers any existing interactions.
    • Additionally, note that the API does not check if there are any agents actually logged in.

Interaction-Related Methods

  • The Request Chat method must be invoked before any other interaction-related method. This method either initiates a new chat session or returns the ID and parameters of an existing chat session if there are any currently existing chat sessions associated with this specific client (e.g., the client app created a chat session, which was then closed or crashed, then restarted before the session timed out on the server).
  • If you plan on using push notifications with your app (i.e., invoke the Mobile Notification Subscription method), note that you must use the Apple Push Notification service (APNs) and/or the Firebase Cloud Messaging (FCM) platform when creating your app.
    • APN certificates and/or FCM server keys must be added in the Contact Center Administrator application, section Scenario Entries > Messaging/Chat > Mobile tab in order to allow notifications to be passed from Bright Pattern Contact Center environments to customers.
    • This method should be invoked after invoking the Request Chat method (i.e., the chatId value required for this method is returned in the Request Chat method).
    • Additionally, this method should be invoked when its device token is changed.


  • For the Get Case History method, note that this request should be made only after the chat_session_case_set server event is received; if the scenario has not specified a case, the request will return an error.


  • For the Close Case method, note that this request should be made only after the chat_session_case_set server event is received; if the scenario has not specified a case, the request will return an error.
    < Previous | Next >