-
public interface ContactCenterCommunicating
-
-
Method Summary
Modifier and Type Method Description abstract UnitcheckAvailability(Function1<Result<ContactCenterServiceAvailability, Error>, Unit> completion)Checks the current status of configured services abstract UnitgetChatHistory(String chatID, Function1<Result<List<ContactCenterEvent>, Error>, Unit> completion)Returns all client events and all server events for the current session. abstract UnitgetCaseHistory(String chatID, Function1<Result<ChatSessionCaseHistoryDto, Error>, Unit> completion)Returns all client events and all server events for all sessions related to the CRM case defined by the scenario which handles a current chat session. abstract UnitrequestChat(String phoneNumber, String from, JSONObject parameters, Function1<Result<ContactCenterChatSessionProperties, Error>, Unit> completion)Request Chat initiates a chat session. abstract UnitsendChatMessage(String chatID, String message, UUID messageID, Function1<Result<String, Error>, Unit> completion)Send a chat message. abstract UnitchatMessageDelivered(String chatID, String messageID, Function1<Result<String, Error>, Unit> completion)Confirms that a chat message has been delivered to the application abstract UnitchatMessageRead(String chatID, String messageID, Function1<Result<String, Error>, Unit> completion)Confirms that a chat message has been read by the user abstract UnitchatTyping(String chatID, Function1<Result<String, Error>, Unit> completion)Informs that a user started to type in a new chat message abstract UnitchatNotTyping(String chatID, Function1<Result<String, Error>, Unit> completion)Informs that a user stopped to type in a new chat message abstract UnitdisconnectChat(String chatID, Function1<Result<String, Error>, Unit> completion)Request to disconnect chat conversation but keep the session active. abstract UnitendChat(String chatID, Function1<Result<String, Error>, Unit> completion)Request to disconnect chat conversation and complete the session. abstract UnitsubscribeForRemoteNotificationsAPNs(String chatID, String deviceToken, Function1<Result<Void, Error>, Unit> completion)Subscribes for push notifications from APNs server This function should be called each time chatIDis changedabstract UnitsubscribeForRemoteNotificationsFirebase(String chatID, String deviceToken, Function1<Result<String, Error>, Unit> completion)Subscribes for push notifications from APNs server when using Firebase service. abstract UnitappDidReceiveMessage(Map<Object, Object> userInfo)Notify contact center library about new remote notification abstract UnitcloseCase(String chatID, Function1<Result<String, Error>, Unit> completion)Closes the CRM case defined by the scenario which handles a current chat session. abstract StringgetBaseURL()Base URL to make requests abstract StringgetTenantURL()Identifies your contact center. abstract StringgetAppID()Unique identifier of the Messaging/Chat scenario entry that will be used to associate your application with a specific scenario abstract StringgetClientID()Unique identifier of the client application. abstract ContactCenterEventsInterfacegetDelegate()Event' callback abstract UnitsetDelegate(ContactCenterEventsInterface delegate)Event' callback -
-
Method Detail
-
checkAvailability
abstract Unit checkAvailability(Function1<Result<ContactCenterServiceAvailability, Error>, Unit> completion)
Checks the current status of configured services
- Parameters:
completion- closure
-
getChatHistory
abstract Unit getChatHistory(String chatID, Function1<Result<List<ContactCenterEvent>, Error>, Unit> completion)
Returns all client events and all server events for the current session. Multiple event objects can be returned; each event's timestamp attribute can be used to restore the correct message order.
- Parameters:
chatID- The current chat IDcompletion- : Chat client and server events or Error otherwise
-
getCaseHistory
abstract Unit getCaseHistory(String chatID, Function1<Result<ChatSessionCaseHistoryDto, Error>, Unit> completion)
Returns all client events and all server events for all sessions related to the CRM case defined by the scenario which handles a current chat session. For each session, multiple event objects can be returned; each event's timestamp attribute can be used to restore the correct message order.
- Parameters:
chatID- The current chat IDcompletion- : Chat sessions with client and server events or Error otherwise
-
requestChat
abstract Unit requestChat(String phoneNumber, String from, JSONObject parameters, Function1<Result<ContactCenterChatSessionProperties, Error>, Unit> completion)
Request Chat initiates a chat session. It provides values of all or some of the expected parameters, and it may also contain the phone number of the mobile device. Note that if the mobile scenario entry is not configured for automatic callback, the agent can still use this number to call the mobile user manually, either upon the agent's own initiative or when asked to do this via a chat message from the mobile user.
- Parameters:
phoneNumber- : phone number for callback, if necessaryfrom- : Propagated into scenario variable $(item.from).parameters- : Additional parameters.completion- : Returns chat session properties that includeschatIDor Error otherwise
-
sendChatMessage
abstract Unit sendChatMessage(String chatID, String message, UUID messageID, Function1<Result<String, Error>, Unit> completion)
Send a chat message. Before message is sent the function generates a
messageIDwhich is returned in a completion- Parameters:
chatID- : The current chat IDmessage- : Text of the messagecompletion- : ReturnsmessageIDin the format chatId:messageNumber where messageNumber is ordinal number of the given message in the chat exchange or Error otherwise
-
chatMessageDelivered
abstract Unit chatMessageDelivered(String chatID, String messageID, Function1<Result<String, Error>, Unit> completion)
Confirms that a chat message has been delivered to the application
- Parameters:
chatID- : The current chat IDmessageID- : The message IDcompletion- : Returns.successor Error otherwise
-
chatMessageRead
abstract Unit chatMessageRead(String chatID, String messageID, Function1<Result<String, Error>, Unit> completion)
Confirms that a chat message has been read by the user
- Parameters:
chatID- : The current chat IDmessageID- : The message IDcompletion- : Returns.successor Error otherwise
-
chatTyping
abstract Unit chatTyping(String chatID, Function1<Result<String, Error>, Unit> completion)
Informs that a user started to type in a new chat message
- Parameters:
chatID- : The current chat IDcompletion- : Returns.successor Error otherwise
-
chatNotTyping
abstract Unit chatNotTyping(String chatID, Function1<Result<String, Error>, Unit> completion)
Informs that a user stopped to type in a new chat message
- Parameters:
chatID- : The current chat IDcompletion- : Returns.successor Error otherwise
-
disconnectChat
abstract Unit disconnectChat(String chatID, Function1<Result<String, Error>, Unit> completion)
Request to disconnect chat conversation but keep the session active. Server may continue communicating with the client
- Parameters:
chatID- : The current chat IDcompletion- : Returns.successor Error otherwise
-
endChat
abstract Unit endChat(String chatID, Function1<Result<String, Error>, Unit> completion)
Request to disconnect chat conversation and complete the session. Server will not continue communicating with the client once request is sent
- Parameters:
chatID- : The current chat IDcompletion- : Returns.successor Error otherwise
-
subscribeForRemoteNotificationsAPNs
abstract Unit subscribeForRemoteNotificationsAPNs(String chatID, String deviceToken, Function1<Result<Void, Error>, Unit> completion)
Subscribes for push notifications from APNs server This function should be called each time
chatIDis changed- Parameters:
chatID- : The current chat IDdeviceToken- : Unique to both the device and the app.completion- : Returns.successor Error otherwise
-
subscribeForRemoteNotificationsFirebase
abstract Unit subscribeForRemoteNotificationsFirebase(String chatID, String deviceToken, Function1<Result<String, Error>, Unit> completion)
Subscribes for push notifications from APNs server when using Firebase service. Firebase gives one more layer of flexibility to have event more granular control of notifications that are sent to the users devices.
This function should be called each time
chatIDis changed- Parameters:
chatID- : The current chat IDdeviceToken- : Unique to both the device and the app.completion- : Returns.successor x-source-tag://ContactCenterError otherwise
-
appDidReceiveMessage
abstract Unit appDidReceiveMessage(Map<Object, Object> userInfo)
Notify contact center library about new remote notification
- Parameters:
userInfo- : Contains a payload with a new event from a backend which is received indidReceiveRemoteNotificationoruserNotificationCenter
-
closeCase
abstract Unit closeCase(String chatID, Function1<Result<String, Error>, Unit> completion)
Closes the CRM case defined by the scenario which handles a current chat session.
- Parameters:
chatID- : The current chat IDcompletion- : Returns.successor x-source-tag://ContactCenterError otherwise
-
getBaseURL
abstract String getBaseURL()
Base URL to make requests
-
getTenantURL
abstract String getTenantURL()
Identifies your contact center. It corresponds to the domain name of your contact center that you see in the upper right corner of the Contact Center Administrator application after login.
-
getAppID
abstract String getAppID()
Unique identifier of the Messaging/Chat scenario entry that will be used to associate your application with a specific scenario
-
getClientID
abstract String getClientID()
Unique identifier of the client application. It is used to identify communication sessions of a particular instance of the mobile application (i.e., of a specific mobile device). It must be generated by the mobile application in the UUID format. If clientId is set to WebChat, HTTP cookies will be used for client identification.
-
getDelegate
abstract ContactCenterEventsInterface getDelegate()
Event' callback
-
setDelegate
abstract Unit setDelegate(ContactCenterEventsInterface delegate)
Event' callback
-
-
-
-