-
public interface ContactCenterCommunicating
-
-
Method Summary
Modifier and Type Method Description abstract Unit
checkAvailability(Function1<Result<ContactCenterServiceAvailability, Error>, Unit> completion)
Checks the current status of configured services abstract Unit
getChatHistory(String chatID, Function1<Result<List<ContactCenterEvent>, Error>, Unit> completion)
Returns all client events and all server events for the current session. 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. abstract Unit
requestChat(String phoneNumber, String from, JSONObject parameters, Function1<Result<ContactCenterChatSessionProperties, Error>, Unit> completion)
Request Chat initiates a chat session. abstract Unit
sendChatMessage(String chatID, String message, UUID messageID, Function1<Result<String, Error>, Unit> completion)
Send a chat message. abstract Unit
chatMessageDelivered(String chatID, String messageID, Function1<Result<String, Error>, Unit> completion)
Confirms that a chat message has been delivered to the application abstract Unit
chatMessageRead(String chatID, String messageID, Function1<Result<String, Error>, Unit> completion)
Confirms that a chat message has been read by the user abstract Unit
chatTyping(String chatID, Function1<Result<String, Error>, Unit> completion)
Informs that a user started to type in a new chat message abstract Unit
chatNotTyping(String chatID, Function1<Result<String, Error>, Unit> completion)
Informs that a user stopped to type in a new chat message abstract Unit
disconnectChat(String chatID, Function1<Result<String, Error>, Unit> completion)
Request to disconnect chat conversation but keep the session active. abstract Unit
endChat(String chatID, Function1<Result<String, Error>, Unit> completion)
Request to disconnect chat conversation and complete the session. 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 chatID
is changedabstract Unit
subscribeForRemoteNotificationsFirebase(String chatID, String deviceToken, Function1<Result<String, Error>, Unit> completion)
Subscribes for push notifications from APNs server when using Firebase service. abstract Unit
appDidReceiveMessage(Map<Object, Object> userInfo)
Notify contact center library about new remote notification 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. abstract String
getBaseURL()
Base URL to make requests abstract String
getTenantURL()
Identifies your contact center. abstract String
getAppID()
Unique identifier of the Messaging/Chat scenario entry that will be used to associate your application with a specific scenario abstract String
getClientID()
Unique identifier of the client application. abstract ContactCenterEventsInterface
getDelegate()
Event' callback abstract Unit
setDelegate(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 includeschatID
or 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
messageID
which is returned in a completion- Parameters:
chatID
- : The current chat IDmessage
- : Text of the messagecompletion
- : ReturnsmessageID
in 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.success
or 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.success
or 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.success
or 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.success
or 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.success
or 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.success
or 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
chatID
is changed- Parameters:
chatID
- : The current chat IDdeviceToken
- : Unique to both the device and the app.completion
- : Returns.success
or 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
chatID
is changed- Parameters:
chatID
- : The current chat IDdeviceToken
- : Unique to both the device and the app.completion
- : Returns.success
or 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 indidReceiveRemoteNotification
oruserNotificationCenter
-
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.success
or 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
-
-
-
-