Skip to content

Rox.Chat Mobile SDK Reference Guide for Android Applications

The revision corresponds to the current version of the Mobile SDK for Android.

N.B.

The answers to the most common questions are given in this article.

Class Rox

A set of static methods that are used to create a session object and to handle push notifications from the Rox.Chat service.

Class method newSessionBuilder()

Method needed to get a SessionBuilder object, which in turn is needed to create an instance of the RoxSession class.

Does not accept parameters.

Returns an instance of the SessionBuilder class required to create a session.

Does not throw exceptions.

Does not require other methods to be called beforehand.

Class method parseGcmPushNotification(Bundle bundle)

Method used to convert an object representing a push notification to an Android application into an object of class RoxPushNotification.

Example usage:

RoxPushNotification pushNotification = Rox.parseGcmPushNotification(intent.getExtras());

The bundle parameter is the serialized push notification data. The type is Bundle.

Returns an object of class RoxPushNotification or null.

Does not throw exceptions.

Does not require other methods to be called beforehand.

Class method parseFcmPushNotification(String message)

Method used to convert a push notification in an Android app, into an object of class RoxPushNotification.

Example usage:

RoxPushNotification pushNotification = Rox.parseFcmPushNotification(remoteMessage.getData().toString());
The message parameter is a push notification. The type is String.

Returns an object of class RoxPushNotification or null.

Does not throw exceptions.

Does not require other methods to be called beforehand.

Class method getGcmSenderId()

A method to get the sender id of push notifications from the Rox.Chat service, if the GCM service is used to receive push notifications.

Example of use:

if (intent.getStringExtra("from").equals(**Rox.Chat**.getGcmSenderId())) {
      // Process Rox.Chat push notification.
  } else {
      // Process your application push notification.
  }

Does not accept parameters.

Returns the ID of the sender of push notifications from Rox.Chat service. The type is String.

Does not throw exceptions.

Does not require calling other methods beforehand.

Class method setOnlineStatusRequestFrequencyInMillis(long requestFrequency)

Method used to set the frequency of requests to the server to get up-to-date information about free operators at the current location.

The requestFrequency parameter is of type long, the interval of requests in milliseconds.

Does not throw exceptions.

Does not return anything.

Called when setting up a session via SessionBuilder.

Enumerated type PushSystem

Push notification systems that can be passed as a parameter to the SessionBuilder setPushSystem(PushSystem pushSystem) instance method.

Case FCM

Corresponds to Firebase Cloud Messaging.

Case GCM

Corresponds to Google Cloud Messaging.

Case NONE

Corresponds to the situation when the application does not need to receive push notifications from the Rox.Chat service.


Class SessionBuilder

A class whose instance is used to get an instance of class RoxSession. An instance of the class is obtained using the newSessionBuilder() method of the Rox class.

Class method setContext(Context context)

The method is intended to pass an application context or some sort of activity for use by SDK methods. The context is needed to create and use message history stored locally on the device, get a token to send push notifications, and get the SharedPreferences object (if not passed directly using the setVisitorDataPreferences(SharedPreferences preferences) method). The SharedPreferences are used to store visitor identity data (see the setVisitorFieldsJson(String visitorFieldsJson) and setVisitorFieldsJson(JsonObject visitorFieldsJson)) instance methods).

The context parameter is the context of the application or some activity. The type is Context.

Returns the same instance of class SessionBuilder, but with the passed context value.

Does not throw exceptions.

Requires a previously obtained instance of class SessionBuilder. Requires a method call to get an instance of class RoxSession.

Class method setAccountName(String accountName)

The method is required to set the account name in the Rox.Chat system when creating a session.

The accountName parameter is the name of the client's account in the Rox.Chat system. Usually it is a URL of the server (for example, https://demo.rox.chat), but it can be a single word account name (for example, "demo"), if the server is in the rox.chat domain. The parameter type is String.

Returns the same instance of the SessionBuilder class, but with the account name set.

Does not throw exceptions.

Requires a previously obtained instance of class SessionBuilder. Requires a method call to get an instance of class RoxSession.

Class method setLocation(String location)

The method is required to set the location initially used when creating a session.

The location parameter is the location within the Rox.Chat service that will be used when chatting. The type of the parameter is String. Most likely, you can use mobile and/or default values right away. To create and further use additional placements, you should contact the Rox.Chat service support team.

Returns the same instance of SessionBuilder class but with the name of the used placement set.

Does not throw exceptions.

Requires a previously obtained instance of class SessionBuilder. A method call is required to get an instance of RoxSession.

Class method setAppVersion(String appVersion)

The method is used to set the version of the client application if they need to be distinguished in the context of the Rox.Chat service.

The appVersion parameter is the version of the client application. The parameter type is String.

Returns the same instance of the SessionBuilder class, but with the client application version installed.

Does not throw exceptions.

Requires a previously obtained instance of class SessionBuilder. No method call is required to get an instance of class RoxSession.

Class method setVisitorDataPreferences(SharedPreferences preferences)

The method is used to pass the SharedPreferences SDK object. It is used to store the authorized user's data (see the setVisitorFieldsJson(String visitorFieldsJson) and setVisitorFieldsJson(JsonObject visitorFieldsJson) methods) and the name of the local message history storage file.

If this method has not been called, the SharedPreferences object will be retrieved from the context (see the setContext(Context context) method).

The data of different authorized users is stored in different SharedPreferences files.

The preferences parameter is the SharedPreferences object of the application.

Returns the same instance of the SessionBuilder class, but with SharedPreferences set.

Does not throw exceptions.

Requires a previously obtained instance of class SessionBuilder. No method call is required to get an instance of class RoxSession.

Class method setVisitorFieldsJson(String visitorFieldsJson)

The method is used for internal visitor authorization.

Without calling this method when creating a session object, the user will be anonymous, with a randomly generated ID. This ID is stored in the application settings, and if these settings are lost (e.g. when reinstalling the application), all data (message history) will be lost.

All data of an authorized user is saved and will be available when authorizing from any device.

Parameter visitorFieldsJson - fields of user authorization data in JSON format, type - String. Detailed information about these fields (including which ones are mandatory and how they should be formed) can be found in this article.

Returns the same instance of the SessionBuilder class, but with the visitor's authorization credentials set.

Does not throw exceptions.

Requires a previously obtained instance of class SessionBuilder. It is optional to call this method to get an instance of class RoxSession.

This method cannot be called concurrently with the setProvidedAuthorizationTokenStateListener(ProvidedAuthorizationTokenStateListener ProvidedAuthorizationTokenStateListener, String providedAuthorizationToken) method.

Class method setVisitorFieldsJson(JsonObject visitorFieldsJson)

A method completely similar to the setVisitorFieldsJson(String visitorFieldsJson) method except for the parameter: the visitorFieldsJson parameter is of type JsonObject. Which of the two methods to use is irrelevant.

Class method setProvidedAuthorizationTokenStateListener(ProvidedAuthorizationTokenStateListener providedAuthorizationTokenStateListener, String providedAuthorizationToken)

When a client application provides its own visitor authorization mechanism, this can be implemented by passing a special token instead of visitor fields.

This method passes an object of a class implementing the ProvidedAuthorizationTokenStateListener interface and a token.

Returns the same instance of the SessionBuilder class, but with the ProvidedAuthorizationTokenStateListener object and visitor authorization client token installed.

Does not throw exceptions.

Requires a previously obtained instance of class SessionBuilder. It is optional to call this method to get an instance of class RoxSession.

This method cannot be called concurrently with the setVisitorFieldsJson(String visitorFieldsJson) or setVisitorFieldsJson(JsonObject visitorFieldsJson) methods.

Class method setTitle(String title)

A method to set the operator-side chat title when creating a session instance. If the method was not called when the session instance was created, the title will take the default value of "Android Client".

The title parameter is the operator-side chat title. The parameter type is String.

Returns the same instance of the SessionBuilder class, but with the operator-side chat title set.

Does not throw exceptions.

Requires a previously obtained instance of class SessionBuilder. It is optional to call method call to get an instance of class* RoxSession.

Class method setErrorHandler(FatalErrorHandler errorHandler)

A method to set an object obeying theFatalErrorHandler interface, which will be responsible for handling session instance errors that may be called by the Rox.Chat service.

The errorHandler parameter is any class that implements the FatalErrorHandler interface.

Returns the same instance of class SessionBuilder, but with the FatalErrorHandler object* installed.

Does not throw exceptions.

Requires a previously obtained instance of class SessionBuilder. Method call is not required to get an instance of class RoxSession.

Class method setPushSystem(PushSystem pushSystem)

A method to specify, when creating a session, whether the application will receive push notifications from the Rox.Chat service and, if so, which push notification system the application will use to do so. (See the enumerated type PushSystem in the Rox class.)

The pushSystem parameter is the corresponding value of type PushSystem of class Rox.

Returns the same instance of class SessionBuilder, but with the system set to use push notifications.

Does not throw exceptions.

Requires a previously obtained instance of class SessionBuilder. For an application to receive push notifications of the Rox.Chat service, calling this method is not sufficient: a call to the setPushToken(String pushToken) method is also required.

To get an instance of class RoxSession, calling the method is not required. If the method was not called when the session was created, the Rox.Chat service will not send push notifications to the application (similar to the value of the pushSystem parameter NONE).

Class method setPushToken(String pushToken)

A method to specify a token for the application to receive push notifications from the Rox.Chat service when creating a session.

The pushToken parameter is the token used to receive push notifications in the application. The type is String in hexadecimal format, with no service characters or spaces.

Returns the same instance of class SessionBuilder, but with the token value set to use push notifications.

Does not throw exceptions.

Requires a previously obtained instance of class SessionBuilder. For an application to receive push notifications of the Rox.Chat service, this method is called together with a call to the setPushSystem(PushSystem pushSystem) method.

Calling this method is useful for debugging.

To get an instance of class RoxSession, calling the method is optional.

Warning!

This method can be used only after session initialization!

Class method setGCMSenderId(String senderId)

A method to set your own GCM Sender Id for push notifications. Without calling this method, the Rox.Chat GCM Sender ID will be used.

The senderId parameter is the value of GCM Sender Id. The type is String.`

Returns the same instance of class SessionBuilder but with GCM Sender Id set.

Requires a previously obtained instance of class SessionBuilder. The method call is optional to get an instance of class RoxSession.

Class method setLogger(RoxLog logger, RoxLogVerbosityLevel verbosityLevel)

The method by which an object of class RoxLog is passed.

The logger parameter is an object of class RoxLog.

The verbosityLevel parameter is the value of RoxLogVerbosityLevel.

Returns the same instance of class SessionBuilder, but with the class object RoxLog installed to log information.

Requires a previously obtained instance of class SessionBuilder. It is optional to call the method to get an instance of class RoxSession.

Class method setStoreHistoryLocally(boolean storeHistoryLocally)

By default, the session stores message history on the device (in the SQLite storage associated with the application). If this functionality needs to be disabled for any purpose, this method is used with the storeHistoryLocally parameter value false.

The storeHistoryLocally parameter is a boolean variable indicating the need to store message history locally (value true) or its (need) absence (value false).

Returns the same instance of the SessionBuilder class, but with the manually set value of the corresponding option.

Does not throw exceptions.

Requires a previously obtained instance of class SessionBuilder. No method call is required to get an instance of class RoxSession. Not calling the method is the same as calling it with isLocalHistoryStoragingEnabled true.

Class method setClearVisitorData(boolean clearVisitorData)

A method used to remove all existing user data at session instance creation time.

The clearVisitorData parameter is a boolean variable indicating the need to clear user data (value true) or its (need) absence (value false).

Returns the same instance of the SessionBuilder class, but with the corresponding option value set manually.

Does not throw exceptions.

Requires a previously obtained instance of class SessionBuilder. No method call is required to get an instance of class RoxSession. Not calling the method is the same as calling it with isVisitorDataClearingEnabled false.

Class method setNotFatalErrorHandler(NotFatalErrorHandler notFatalErrorHandler notFatalErrorHandler)

A method to set an object obeying the NotFatalErrorHandler interface that will be responsible for handling session instance creation errors that may be caused by the Rox.Chat service.

The notFatalErrorHandler parameter is any class that implements the NotFatalErrorHandler interface.

Returns the same instance of class SessionBuilder, but with the NotFatalErrorHandler object installed.

Does not throw exceptions.

Requires a previously obtained instance of class SessionBuilder. It is optional to call the method to get an instance of class RoxSession.

Class method build()

A method that is called at the conclusion of the above methods to get an instance of RoxSession.

Does not accept parameters.

Returns a RoxSession object with parameters set using the rest of the class instance methods.

Throws an IllegalArgumentException in the following cases:

Requires a previously obtained instance of the SessionBuilder class, and subsequent calls to the setAccountName(String accountName) and setLocation(String location) methods (in any order). Any other (in any order and combination) of the SessionBuilder class instance methods may also be called beforehand.

Class method build(RoxSession.SessionCallback callback)

A method that is called at the conclusion of the above methods to get an instance of RoxSession.

The callback parameter is an object that implements the RoxSession.SessionCallback interface.

Returns a RoxSession object with the parameters set using the rest of the class instance methods.

Throws an IllegalArgumentException in the following cases:

Requires a previously obtained instance of the SessionBuilder class, and subsequent calls to the setAccountName(String accountName) and setLocation(String location) methods (in any order). Also, any other (in any order and combination) methods of the SessionBuilder class instance may be called beforehand.

Enumerated type RoxLogVerbosityLevel

Specifies the degree of informativeness of the records passed to the RoxLog object.

Case VERBOSE

All available information will be passed to the RoxLog object with the maximum level of informativeness:

  • network connection configuration parameters;

  • URLs, HTTP methods and network request parameters;

  • HTTP codes, received data and network request response errors;

  • SQL queries and errors that occur with these queries;

  • complete information that may be useful in debugging, and additional notes.

Case DEBUG

All information necessary for debugging will be passed to the RoxLog object with the required level of informativeness:

  • network connection configuration parameters;

  • URLs, HTTP methods and network request parameters;

  • HTTP codes, received data and network request response errors;

  • SQL queries and errors that occur with these queries;

  • complete information that may be useful in debugging, with a moderate level of informativeness.

Case INFO

The RoxLog object will be passed background information, as well as all warnings and errors:

  • URLs, HTTP methods and network request parameters;

  • HTTP codes and errors of responses to network requests that failed;

  • SQL query errors.

Case WARNING

Only warnings and errors will be passed to the RoxLog object:

  • HTTP codes and network request response errors that failed;

  • SQL query errors.

Case ERROR

Only errors will be passed to the RoxLog object:

  • HTTP codes and network request response errors that failed.

Interface ProvidedAuthorizationTokenStateListener

If the client provides its own visitor authorization mechanism, this can be implemented by passing a special token that is used instead of visitor fields (see the setVisitorFieldsJson(String visitorFieldsJson and setVisitorFieldsJson(JsonObject visitorFieldsJson) methods).

At the moment this token is generated (or receives a passed value), the update(String providedAuthorizationToken) method is called. This means that the client service must pass this token to the Rox.Chat service.

This mechanism is not a self-contained implementation. The client service must support and implement methods to pass the token and visitor data to the Rox.Chat service.

Instance method update(String providedAuthorizationToken)

The method is called in two cases:

  1. The token of the client authorization mechanism is provided or generated and it is required to send it to the Rox.Chat service by the client.

  2. information is received from Rox.Chat service that the token used is unknown to it. This may happen, for example, if the token was not sent to the Rox.Chat service by the client's service or was not received by the Rox.Chat service. In this case Rox.Chat service needs to provide the token and corresponding visitor's data.

The providedAuthorizationToken parameter is the token of the client authorization mechanism.

Does not return anything.

Does not throw exceptions

Does not require any other methods to be called beforehand.


Interface RoxSession

An interface that allows manipulation of the current session. It is implemented by internal SDK entities.

An instance of class RoxSession is obtained using methods of class SessionBuilder.

N.B.

By itself, RoxSession does not start a chat. To start a chat, you must call either startChat() or startChatWithDepartmentKey(String departmentKey)

Method resume()

When an instance of class RoxSession is created, its corresponding session is in a suspended state. This method is required to start the session's network activity.

Does not accept parameters.

Returns nothing.

Throws an IllegalStateException if the session object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the class object was created.

Does not require any other methods to be called beforehand. Necessary for the service to function fully in the application context.

The speed of method execution depends on the speed of receiving the server response. Various methods MessageListener, ChatStateListener, CurrentOperatorChangeListener, and LocationSettingsChangeListener can be called as a result of the server response.

Method pause()

A method that is used to suspend the network activity of a session. If the session is already in a suspended state, the method does not perform any action.

Does not accept any parameters.

Does not return anything.

Throws a RuntimeException if the method was called from a thread other than the one in which the class object was created.

Does not require any other methods to be called beforehand. The session must not be in a deactivated state to call the method.

Method destroy()

A method that is used to deactivate the session and class instance. Once this method is called, no methods related to the session can be used.

Does not accept parameters.

Does not return anything.

Throws a RuntimeException if the method was called from a thread other than the one in which the class object was created.

Does not require any other methods to be called beforehand.

Method destroyWithClearVisitorData()

A method that is used to deactivate the session and class instance with user information removed. Once this method is called, no methods related to the session can be used.

Does not accept parameters.

Returns nothing.

Throws a RuntimeException if the method was called from a thread other than the one in which the class object was created.

Does not require any other methods to be called beforehand.

Method getStream()

The method to call to retrieve the corresponding MessageStream instance session.

Does not accept parameters.

Returns the corresponding session instance of the MessageStream class. Each call to this method in the context of a single class object returns the same MessageStream object.

Does not throw exceptions.

Does not require any other methods to be called beforehand, but the session must not be suspended or deactivated to fully utilize the methods of the MessageStream interface (see the resume(), pause(), and destroy() methods).

Method changeLocation(String location)

The method is used to change the name of a location within an existing session. Calling the method approximates the result of creating a new session with similar parameters, but with a different location name.

The location parameter is the name of the location to which the current session value should be changed. The type is String.

Does not return anything.

Does not throw exceptions.

To call the method, the session must not be in suspended or deactivated state (see methods resume(), pause() and destroy()).

The speed of method execution depends on the speed of receiving a response from the server.

Method setPushToken(String pushToken)

The method is used to set the push token to receive push notifications.

The pushToken parameter is the token used to receive push notifications in the application. The type is String.

Does not return anything.

Throws an IllegalStateException if the session object has been deactivated (see the destroy() method), and if the push notification system has not been configured properly (see the setPushSystem(PushSystem pushSystem) method of the SessionBuilder class).

Throws a RuntimeException if the method was called from a thread other than the one in which the class object was created.

Method removePushToken(TokenCallback tokenCallback)

The method is used to disable push notifications.

The tokenCallback parameter is an object that implements the TokenCallback interface.

Throws an IllegalStateException if the session object has been deactivated (see the destroy() method) and if the push notification system has not been properly configured (see the setPushSystem(PushSystem pushSystem) method of the SessionBuilder class).

Throws a RuntimeException if the method was called from a thread other than the one in which the class object was created.


Interface getMessagesCallback

An object that implements the interface can be passed in the messagesCallback parameter of the loadAllHistorySince(Message sinceMessage, getMessagesCallback messagesCallback) protocol MessageTracker method.

Method receive(List messages)

The method is called when the call to the loadAllHistorySince(Message sinceMessage, getMessagesCallback messagesCallback) method of the MessageTracker protocol succeeds.

The messages parameter is a list of messages that were found as a result of the search query.

Does not return anything.

Does not throw exceptions.

Does not require calling any other methods beforehand. Type - List.


Interface Quote

The interface is an abstraction representing information about the quoted message.

The interface is implemented by internal SDK entities. The Quote object can be retrieved using the getQuote() method of the Message() interface.

Method getState()

Use this method to get the status of a quote.

Does not accept parameters.

Returns a value of enumerated type State.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getMessageAttachment()

Use this method to get an attachment if it is a file sent by a visitor or operator (Type FILE_FROM_OPERATOR or FILE_FROM_VISITOR).

Does not accept parameters.

Returns an instance of class MessageAttachment or null if the file is in the process of being sent.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getMessageId()

Use this method to get the unique ID of the quoted message.

Does not accept any parameters.

Returns the ID of the message. The type is String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getMessageType()

Use this method to get the type of the quoted message.

Does not accept any parameters.

Returns the value of the enumerated type MessageType.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getSenderName()

Use this method to get the name of the message sender.

Does not accept any parameters.

Returns the name of the sender of the message. The type is String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getMessageText()

Use this method to get the text of the message.

Does not accept any parameters.

Returns the text of the message. The type is String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getMessageTimestamp()

Use this method to get the time the message was sent.

Does not accept any parameters.

Returns the number of milliseconds elapsed from the beginning of the epoch until the message is processed by the server. The type is long.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getAuthorId()

Use this method to get the author ID of the author of the quoted message.

Does not accept any parameters.

Returns the ID of the message. The type is String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.


Interface Keyboard

The interface is an abstraction that provides the elements of a chatbot keyboard.

The interface is implemented by internal SDK entities. The Keyboard object can be retrieved using the getKeyboard() method of the Message interface.

Method getButtons()

A method that can be used to get a list of buttons for a keyboard element.

Takes no parameters.

Returns a KeyboardButtons object.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getState()

A method that can be used to get the state of the keyboard.

Takes no parameters.

Returns a value of the enumerated type State.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getKeyboardResponse()

Method that can be used to retrieve a user-selected button.

Does not take any parameters.

Returns a KeyboardResponse object.

Does not throw exceptions.

Does not require any other methods to be called beforehand.


Interface KeyboardButtons

The interface is an abstraction representing information about the chatbot's keyboard buttons.

The interface is implemented by internal SDK entities. The KeyboardButtons object can be retrieved using the getButtons() method of the Keyboard interface.

Method getId()

A method that can be used to get the unique ID of a button in the chatbot keyboard.

Does not take parameters.

Returns the ID in text form. The type is String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getText()

A method that can be used to get the text of a button in the chatbot keyboard.

Does not take any parameters.

Returns the name of the button in text form. The type is String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.


Interface KeyboardResponse

The interface is an abstraction representing information about the selected button in the chatbot keyboard.

The interface is implemented by internal SDK entities. The KeyboardResponse object can be retrieved using the getKeyboardResponse() method of the Keyboard interface.

Method getbuttonId()

Method that can be used to get the unique ID of the selected button in the chatbot keyboard.

Does not accept parameters.

Returns the ID in text form. The type is String. Button ID can contain only Latin letters, digits, hyphen and underscore characters and must be no more than 24 characters long. The button ID generated on the Rox.Chat side has the format UUID4, and the ID generated externally (including third-party bots) is only checked for compliance with the above criteria.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getMessageId()

Method that can be used to get the ID of the message in which the button was selected.

Takes no parameters.

Returns the name of the message ID in text form. The type is String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.


Interface MessageStream

An interface implemented by internal SDK entities.

The class instance with which the interface methods are called exists only one within a session and is obtained using the getStream()method of an instance of the RoxSession class. Interface methods are used directly to interact with the Rox.Chat service (such as sending and receiving messages).

To use the interface methods, it is necessary that the session is not in suspended or deactivated state (see the resume(), pause() and destroy() methods of the RoxSession class).

Method closeSurvey(SurveyCloseCallback callback)

Use this method to close the survey.

The callback parameter is an object that implements the SurveyCloseCallback interface.

It does not return anything.

It does not throw any exceptions.

Also if the closure succeeds the SurveyListener.onSurveyCanceled() method will be called.

Method deleteUploadedFiles(String fileGuid, DeleteUploadedFileCallback deleteUploadedFileCallback)

A method to delete files from the Rox.Chat server.

The fileGuid parameter is the id of the file to be deleted (see the UploadedFile interface). The type is String.

The deleteUploadedFileCallback parameter is an object that implements the methods of the DeleteUploadedFileCallback interface.

Returns nothing.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

Does not require any other methods to be called beforehand.

The execution speed of the method depends on the speed of the server response. Various MessageListener methods can be called as a result of the server response.

Method getVisitSessionState()

A method that can be used to get the current session state.

Does not accept parameters.

Returns the current session state with a value of type VisitSessionState.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getChatState()

A method that can be used to specify the state of the current chat.

Does not accept parameters.

Returns a value of enumerated type ChatState.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

Does not require any other methods to be called beforehand.

Method getUnreadByOperatorTimestamp()

Takes no parameters.

Returns the point in time (of type Date) after which all chat messages are unread by the operator (at the time of the update received from the server).

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getUnreadByVisitorMessageCount()

Takes no parameters.

Returns the number of unread messages by the user.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getUnreadByVisitorTimestamp()

Takes no parameters.

Returns the point in time (of type Date) after which all chat messages are unread by the visitor (at the time of the update received from the server).

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getDepartmentList()

Takes no parameters.

Returns a list of departments by a list of objects of type Department or null if no departments are in use or no department list has been retrieved yet.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getLocationSettings()

Each location can have individual settings. Use the current method to get an object representing the current location settings.

Takes no parameters.

Returns an object of class LocationSettings corresponding to the current session.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getCurrentOperator()

Use this method to specify information about the current operator (if any) of the current chat session.

Takes no parameters.

Returns an object of class Operator or null if the chat does not currently have an operator.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

Does not require any other methods to be called beforehand.

Method getLastOperatorRating(Operator.Id operatorId)

Use this method to specify the current rating (in integers from 0 to 5) of an operator, knowing the ID of that operator (see the getId() method of the Operator interface).

The ID parameter is the ID of the operator whose rating the method should return. The type is Operator.Id.

Returns the rating of the operator with ID corresponding to the value of the ID parameter, in integers from 1 to 5 or 0 if the operator has no rating. Type is Int.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

Does not require any other methods to be called beforehand.

Method rateOperator(Operator.Id operatorId, int rate, RateOperatorCallback rateOperatorCallback)

Use this method to send the operator rating of the current visitor.

The operatorId parameter is the ID of the operator whose rating should be sent to the Rox.Chat service. The type is Operator.Id.

Parameter rate - the operator's score to be sent to Rox.Chat service. The rate must be an integer from 1 to 5. The type is int.

The rateOperatorCallback parameter is an object that implements the rateOperatorCallback interface.

Does not return anything.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

Does not require any other methods to be called beforehand.

The speed of method execution depends on the speed of receiving a response from the server.

Warning!

Implementation of the operator evaluation mechanism is left to the developers of the mobile application!

Method respondSentryCall(String id)

This method can be used to transfer a chat to the operator on duty.

The ID parameter is the ID of the message to transfer to the on-duty operator. The type is String.

Does not return anything.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

Does not require any other methods to be called beforehand.

The speed of method execution depends on the speed of receiving a response from the server.

Method replyMessage(String message, Message quotedMessage

The method is used to quote a visitor's message to the Rox.Chat service.

The message parameter is the message to be sent. The type is String.

Parameter quotedMessage - quoted message. The type is Message.

Returns true if the message is quoted, and false otherwise.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

Does not require any other methods to be called beforehand. If there are MessageTracker. and MessageListener objects. , sending a message will invoke the messageAdded(Message before, Message message) method of the MessageListener interface with a new message with status SENDING of enumerated type SendStatus.

The execution speed of the method depends on the speed of receiving the server response. As a result of the server response, various MessageListener methods may be called.

Method sendKeyboardRequest(String requestMessageId, String buttonId, sendKeyboardCallback sendKeyboardCallback)

The method is used to send the selected item in the chatbot keyboard to the Rox.Chat service.

The requestMessageId parameter is the Id of the requested message.

Parameter buttonId - Id of the item in the chatbot keyboard.

Parameter sendKeyboardCallback - An object that implements methods of the SendKeyboardCallback interface.

Does not return anything.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Does not require any other methods to be called beforehand.

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

The speed of method execution depends on the speed at which the server response is received.

Method setGreetingMessageListener(GreetingMessageListener listener)

Use this method to get a greeting message.

The listener parameter is an object of a class that implements the GreetingMessageListener interface.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

Does not require any other methods to be called beforehand.

Method sendFiles(List<UploadedFile> uploadedFiles, SendFilesCallback sendFilesCallback)

A method to send uploaded files to the Rox.Chat server.

The uploadedFiles parameter is a list of files to be sent.

The sendFilesCallback parameter is an object that implements the methods of the SendFilesCallback interface.

Returns a randomly generated ID for this message, which can be used to identify this particular message within the application logic. The type is Message.Id.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

Before calling it is required to upload files to the Rox.Chat server (see the uploadFilesToServer(File file file, String name, String mimeType, UploadFileToServerCallback uploadFileToServerCallback) method). If MessageTracker and MessageListener objects exist, sending a message will invoke the messageAdded(Message before, Message message message) method of the MessageListener interface with a new message with status SENDING of enumerated type SendStatus.

The execution speed of the method depends on the speed of receiving the server response. Various MessageListener methods may be called as a result of the server response.

Method startChat()

Method starts a chat without assignment to a department (assignment to the No Department department). In terms of the Rox.Chat service, changes the current chat's state, represented by the type ChatState, to QUEUE.

Does not accept parameters.

Does not return anything.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

Does not require any other methods to be called beforehand. Calling this method is optional. When a user sends a message or file, the chat starts automatically.

The speed of the method execution depends on the speed of receiving a response from the server.

As a result, the onStateChange(ChatState oldState, ChatState newState) method of the ChatStateListener interface may be called.

N.B.

The welcome message for a visitor will only appear if the startChat() method is used and a welcome message for a non-department operator is written, or if the startChatWithDepartmentKey(String departmentKey) method is used (provided that welcome messages for each department are written).

Method startChatWithDepartmentKey(String departmentKey)

The method starts a chat with an assignment to the specified department. In terms of the Rox.Chat service, it changes the current chat state, represented by the type ChatState, to QUEUE.

The departmentKey parameter is the value of the department key, which can be retrieved by the getKey() method of the Department interface. The type is String.

Returns nothing.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

When a user sends a message or file, chat starts automatically, but if the current state is VisitSessionStateDEPARTMENT_SELECTION, chat must be started using this method or the startChatWithDepartmentKeyFirstQuestion(String departmentKey, String firstQuestion) method.

As a result, the onStateChange(ChatState oldState, ChatState newState) method of the ChatStateListener interface may be called.

N.B.

The welcome message for a visitor will only appear if the startChat() method is used and a welcome message for a non-department operator is written, or if the startChatWithDepartmentKey(String departmentKey) method is used (provided that welcome messages for each department are written).

Method startChatWithFirstQuestion(String firstQuestion)

The method starts the chat and simultaneously sends the visitor's first message.

In terms of the Rox.Chat service, it changes the current chat state, represented by the type ChatState, to QUEUE.

The firstQuestion parameter is the user's first message. The type is String.

Returns nothing.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the thread in which the RoxSession object was created.

As a result, the onStateChange(ChatState oldState, ChatState newState) method of the ChatStateListener interface may be called.

Method startChatWithCustomFields(String customFields)

The method starts a chat with the specified custom fields.

In terms of Rox.Chat service, it changes the current chat state, represented by the type ChatState, to QUEUE.

The customFields parameter is additional fields in JSON format. The type is String.

Does not return anything.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the thread in which the RoxSession object was created.

As a result, the onStateChange(ChatState oldState, ChatState newState) method of the ChatStateListener interface may be called.

Method startChatWithDepartmentKeyFirstQuestion(String departmentKey, String firstQuestion)

The method starts a chat by specifying a particular department and simultaneously sends the visitor's first message.

In terms of Rox.Chat service, it changes the current chat state, represented by the type ChatState, to QUEUE.

The departmentKey parameter is the value of the department key, which can be retrieved by the getKey() method of the Department interface. The type is String.

The firstQuestion parameter is the first message of the user. The type is String.

Returns nothing.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

When a user sends a message or file, chat starts automatically, but if the current state is VisitSessionStateDEPARTMENT_SELECTION, chat must be started using this method or the startChatWithDepartmentKey(String departmentKey) method.

As a result, the [onStateChange(ChatState oldState, ChatState newState)](#changed-state-previous-state-to-new-state) method of the ChatStateListener interface may be called.

Method startChatWithCustomFieldsFirstQuestion(String customFields, String firstQuestion)

The method starts a chat by specifying additional fields and simultaneously sends the visitor's first message.

In terms of the Rox.Chat service, it changes the current chat state, represented by the type ChatState, to QUEUE.

The customFields parameter is additional fields in JSON format. The type is String.

Parameter firstQuestion - the first message of the user. Type - String.

Returns nothing.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the thread in which the RoxSession object was created.

As a result, the onStateChange(ChatState oldState, ChatState newState) method of the ChatStateListener interface may be called.

Method startChatWithCustomDepartmentKey(String customFields, String departmentKey)

The method starts a chat by specifying custom fields and department.

In terms of Rox.Chat service, it changes the current chat state, represented by the type ChatState, to QUEUE.

The customFields parameter is additional fields in JSON format. The type is String.

Parameter departmentKey - department key value that can be retrieved by the getKey() method of the Department interface. The type is String.

Returns nothing.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

When a user sends a message or file, chat starts automatically, but if the current state is VisitSessionStateDEPARTMENT_SELECTION, chat must be started using this method or the startChatWithDepartmentKey(String departmentKey) method.

As a result, the onStateChange(ChatState oldState, ChatState newState) method of the ChatStateListener interface may be called.

Method startChatWithFirstQuestionCustomFieldsDepartmentKey(String firstQuestion, String customFields, String departmentKey)

The method starts a chat with additional fields and department and sends the visitor's first message at the same time.

In terms of Rox.Chat service, it changes the current chat state, represented by the type ChatState, to QUEUE.

The firstQuestion parameter is the user's first message. The type is String.

Parameter customFields - additional fields in JSON format. Type - String.

Parameter departmentKey - department key value that can be obtained by the getKey() method of the Department interface. The type is String.

Returns nothing.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

When a user sends a message or file, chat starts automatically, but if the current state is VisitSessionStateDEPARTMENT_SELECTION, chat must be started using this method or the startChatWithDepartmentKey(String departmentKey) method.

As a result, the onStateChange(ChatState oldState, ChatState newState) method of the ChatStateListener interface may be called.

Method closeChat() (@deprecated)

The method sends a signal to the Rox.Chat service that the visitor has finished chatting. In terms of the Rox.Chat service, changes the current chat state, represented by the type ChatState, to CLOSED_BY_VISITOR.

Does not accept parameters.

Does not return anything.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

Does not require any other methods to be called beforehand. Calling this method is optional.

The speed of execution of the method depends on the speed of receiving a response from the server.

As a result, the onStateChange(ChatState oldState, ChatState newState) method of the ChatStateListener interface may be called.

Method setChatRead()

Method sends a signal to the Rox.Chat service that the visitor has read the chat. Does not accept parameters.

Does not return anything.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

Does not require any other methods to be called beforehand. Calling this method is optional.

Method setVisitorTyping(String draftMessage)

The method is used to send a signal to the Rox.Chat service that the visitor is typing a message (or has stopped typing it).

If the method is called multiple times consecutively, the draft is sent to the Rox.Chat service not at the same frequency, but not more often than once per second.

The draftMessage parameter is the message that the visitor has already entered in the corresponding field, but has not sent it. Type - String, the value of the parameter null corresponds to the situation when the visitor has stopped entering the message or erased the written message from the input field.

Returns nothing.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

Does not require any other methods to be called beforehand.

The result of the method depends on the speed of the network.

Method sendMessage(String message, String data, DataMessageCallback dataMessageCallback)

The method is used to send a visitor's message to the Rox.Chat service.

The message parameter is the message to be sent. The type is String.

The data parameter is used to send message parameters to the server (if the server version supports this functionality) in JSON format. The type is String.

The dataMessageCallback parameter is an object that implements the methods of the DataMessageCallback interface.

Returns a randomly generated ID for this message, which can be used to identify this particular message within the application logic. Type is Message.Id.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

Does not require any other methods to be called beforehand. If MessageTracker and MessageListener objects exist, sending a message will call the messageAdded(Message before, Message message) interface MessageListenerwith a new message with status SENDING of enumerated type SendStatus.

The execution speed of the method depends on the speed of receiving the server response. Various MessageListener methods may be called as a result of the server response.

Method sendMessage(String message, boolean isHintQuestion)

The method is used to send a visitor's message to the Rox.Chat service.

The message parameter is the message to be sent. The type is String.

The isHintQuestion parameter is used if the application has its own mechanism of showing hints to the user. Type - boolean. In case the visitor does not enter the message manually, but chooses one of the offered prompts, the value of the parameter should be true, and false - in the opposite case. The parameter is optional and may be omitted.

Returns a randomly generated ID for this message, which can be used to identify this particular message within the application logic. Type is Message.Id.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

Does not require any other methods to be called beforehand. If MessageTracker and MessageListener objects exist, sending a message will call the messageAdded(Message before, Message message) interface MessageListenerwith a new message with status SENDING of enumerated type SendStatus.

The execution speed of the method depends on the speed of receiving the server response. Various MessageListener methods may be called as a result of the server response.

Method sendMessage(String message)

Fully corresponds to the send(String message, boolean isHintQuestion) method with the isHintQuestion parameter omitted.

Method sendFile(File file file, String name, String mimeType, SendFilesCallback callback)

The method is used to send a file from the visitor to the operator.

The file parameter is the file itself in File format.

The name parameter is the name of the file. The type is String.

The mimeType parameter is the MIME type of the file being sent. The type is String.

The callback parameter is an object that implements the methods of the SendFilesCallback interface.

Returns a randomly generated ID for this message, which can be used to identify this particular message within the application logic. (The file being sent is also a message type.) The type is Message.Id.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

Does not require any other methods to be called beforehand. If MessageTracker and MessageListener objects exist, sending a message will call the messageAdded(Message before, Message message) interface MessageListenerwith a new message with status SENDING of enumerated type SendStatus.

The execution speed of the method depends on the speed of receiving the server response. Various MessageListener methods may be called as a result of the server response.

Method newMessageTracker(MessageListener listener)

The method is used to get an instance of MessageTracker class.

The listener parameter is an object of the class that implements the methods of the MessageListener interface.

Returns an instance of the MessageTracker class corresponding to the current MessageStream object.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

Does not require any other methods to be called beforehand. Getting a new instance of class MessageTracker automatically destroys the previous instance of class MessageTracker.

Method setVisitSessionStateListener(VisitSessionStateListener visitSessionStateListener)

The method passes to the SDK a reference to an object that implements the methods of the visitSessionStateListener interface.

The visitSessionStateListener parameter is an object that implements the methods of the visitSessionStateListener interface.

Returns nothing.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

Does not require any other methods to be called beforehand.

Method setChatStateListener(ChatStateListener listener)

The method passes an object reference to the SDK that implements the methods of the ChatStateListener interface.

The chatStateListener parameter is an object that implements the methods of the ChatStateListener interface.

Returns nothing.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

Does not require any other methods to be called beforehand.

Method setCurrentOperatorChangeListener(CurrentOperatorChangeListener listener)

The method passes to the SDK a reference to an object that implements the methods of the CurrentOperatorChangeListener interface.

The listener parameter is an object that implements the methods of the CurrentOperatorChangeListener interface.

Returns nothing.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

Does not require any other methods to be called beforehand.

Method setDepartmentListChangeListener(DepartmentListChangeList departmentListChangeListener)

The method passes to the SDK a reference to an object that implements the methods of the departmentListChangeListener interface.

The departmentListChangeListener parameter is an object that implements the methods of the DepartmentListChangeListener interface.

Returns nothing.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

Does not require any other methods to be called beforehand.

Method setOperatorTypingListener(OperatorTypingListener listener)

The method passes to the SDK a reference to an object that implements the methods of the OperatorTypingListener interface.

The listener parameter is an object that implements the methods of the OperatorTypingListener interface.

Does not return anything.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

Does not require any other methods to be called beforehand.

Method setLocationSettingsChangeListener(LocationSettingsChangeListener locationSettingsChangeListener)

The method passes to the SDK a reference to an object that implements the methods of the LocationSettingsChangeListener interface.

The locationSettingsChangeListener parameter is an object that implements the methods of the LocationSettingsChangeListener interface.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method setOnlineStatusChangeListener(OnlineStatusChangeListener onlineStatusChangeListener)

The method passes to the SDK a reference to an object that implements the methods of the OnlineStatusChangeListener interface.

The onlineStatusChangeListener parameter is an object that implements the methods of the OnlineStatusChangeListener interface.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method setUnreadByOperatorTimestampChangeListener(UnreadByOperatorTimestampChangeListener listener)

The method passes to the SDK a reference to an object that implements the methods of the UnreadByOperatorTimestampChangeListener interface.

The listener parameter is an object that implements the methods of the UnreadByOperatorTimestampChangeListener interface.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method setUnreadByVisitorMessageCountChangeListener(UnreadByVisitorMessageCountChangeListener listener)

The method passes to the SDK a reference to an object that implements the methods of the UnreadByVisitorMessageCountChangeListener interface.

The listener parameter is an object that implements the methods of the UnreadByVisitorMessageCountChangeListener interface.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method setUnreadByVisitorTimestampChangeListener(UnreadByVisitorTimestampChangeListener listener)

The method passes to the SDK a reference to an object that implements the methods of the UnreadByVisitorTimestampChangeListener interface.

The listener parameter is an object that implements the methods of the UnreadByVisitorTimestampChangeListener interface.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method uploadFilesToServer(File file, String name, String mimeType, UploadFileToServerCallback uploadFileToServerCallback)

A method to upload files to the Rox.Chat server.

The file parameter is the file itself in File format.

The name parameter is the name of the file. The type is String.

The mimeType parameter is the MIME type of the file to be transferred. The type is String.

The uploadFileToServerCallback parameter is an object that implements the methods of the UploadFileToServerCallback interface.

Returns a randomly generated ID for this message, which can be used to identify this particular message within the application logic. The type is Message.Id.

Throws an IllegalStateException if the RoxSession object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the RoxSession object was created.

Does not require any other methods to be called beforehand.

The execution speed of the method depends on the speed of the server response. As a result of the server response, various MessageListener methods may be called.


Interface DataMessageCallback

An interface whose methods are implemented by some application class.

An object that obeys the interface can be passed in a parameter to the callback method sendMessage(String message, String data, DataMessageCallback dataMessageCallback) of the MessageStream interface.

Method onSuccess(Message.Id id id)

The method is called when a message is successfully sent using the sendMessage(String message, String data, DataMessageCallback dataMessageCallback) method of the MessageStream interface.

The ID parameter is the ID of the corresponding message. The type is Message.Id.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

The method will be called after the sendMessage(String message, String data, DataMessageCallback dataMessageCallback) method completes.

Method onFailure(Message.Id id id, RoxError<DataMessageError> error)

Called when a message is sent unsuccessfully using the sendFile(File file, String name, String mimeType, SendFilesCallback callback) method of the MessageStream interface.

The ID parameter is the ID of the corresponding message. The type is Message.Id.

The error parameter is the error that prevented the message from being sent successfully. The type is RoxError<DataMessageError>.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

The method will be called after the method sendMessage(String message, String data, DataMessageCallback dataMessageCallback) is completed.


Interface DeleteUploadedFileCallback

An object obeying the interface can be passed in the deleteUploadedFileCallback parameter of the deleteUploadedFiles(String fileGuid, DeleteUploadedFileCallback deleteUploadedFileCallback) method of the MessageStream interface.

Method onSuccess()

The method is called when a file is successfully uploaded using the deleteUploadedFiles(String fileGuid, DeleteUploadedFileCallback deleteUploadedFileCallback) method of the MessageStream interface.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

The method will be called after the deleteUploadedFiles(String fileGuid, DeleteUploadedFileCallback deleteUploadedFileCallback) method completes.

Method onFailure(RoxError<DeleteUploadedFileError> error)

Called when file uploading fails using the deleteUploadedFiles(String fileGuid, DeleteUploadedFileCallback deleteUploadedFileCallback) method of the MessageStream interface.

The error parameter is the error that prevented the file from being successfully uploaded. The type is DeleteUploadedFileError.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

The method will be called after the method deleteUploadedFiles(String fileGuid, DeleteUploadedFileCallback deleteUploadedFileCallback) is completed.


Interface KeyboardRequest

The interface is an abstraction representing information about the selected button in the chatbot keyboard.

The interface is implemented by internal SDK entities. The KeyboardRequest object can be retrieved using the getKeyboardRequest() method of the Message interface.

Method getButtons()

A method that can be used to get the selected button of a keyboard element.

Takes no parameters.

Returns a KeyboardButtons object.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getMessageId()

A method that can be used to get the ID of the message in which the button was selected.

Takes no parameters.

Returns the name of the message ID in text form. The type is String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.


Interface SendFilesCallback

An interface whose methods are implemented by some application class.

An object subject to the interface can be passed in the sendFilesCallback parameter of the sendFiles(List<UploadedFile> uploadedFiles, SendFilesCallback sendFilesCallback) method of the MessageStream interface.

Method onSuccess(Message.Id id id)

The method is called when a file is successfully sent using the sendFiles(List<UploadedFile> uploadedFiles, SendFilesCallback sendFilesCallback) method of the MessageStream interface.

The ID parameter is the ID of the corresponding message. The type is Message.Id.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

The method will be called after the sendFiles(List<UploadedFile> uploadedFiles, SendFilesCallback sendFilesCallback) method completes.

Method onFailure(Message.Id id id, RoxError<SendFileError> error)

Called when sending a file fails using the sendFiles(List<UploadedFile> uploadedFiles, SendFilesCallback sendFilesCallback) method of the MessageStream interface.

The ID parameter is the ID of the corresponding message. The type is Message.Id.

The error parameter is the error that prevented the file from being sent successfully. The type is RoxError<SendFileError>.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

The method will be called after the method sendFiles(List<UploadedFile> uploadedFiles, SendFilesCallback sendFilesCallback) is completed.


Interface SendStickerCallback

An object implementing the interface can be passed in the sendStickerCallback parameter of the sendSticker(int, SendStickerCallback) method of the MessageStream protocol.

Method onSuccess()

The method is called when the call to the sendSticker(int, SendStickerCallback) method of the MessageStream protocol succeeds.

Does not accept parameters.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method onFailure(RoxError sendStickerErrorRoxError)

The method is called when the sendSticker(int, SendStickerCallback) method of the MessageStream protocol fails.

The sendStickerErrorRoxError parameter is the error that occurred. The type is RoxError.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.


Interface RateOperatorCallback

An object that implements the interface can be passed in the rateOperatorCallback parameter of the rateOperator(Operator.Id operatorId, int rate, RateOperatorCallback rateOperatorCallback) protocol MessageStream method.

Method onSuccess()

The method is called when the call to the rateOperator(Operator.Id operatorId, int rate, RateOperatorCallback rateOperatorCallback) method of the MessageStream protocol succeeds.

Does not accept parameters.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method onFailure(RoxError<RateOperatorError> rateOperatorError)

The method is called when the call to the rateOperator(Operator.Id operatorId, int rate, RateOperatorCallback rateOperatorCallback) protocol MessageStream method fails.

The rateOperatorError parameter is the error that occurred. The type is RoxError<RateOperatorError>.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.


Interface visitSessionStateListener

An interface whose methods are implemented by some application class. An object implementing the interface can be passed in the visitSessionStateListener parameter of the setVisitSessionStateListener(VisitSessionStateListener visitSessionStateListener) method of the MessageStream interface.

Used to track session status changes.

Method onStateChange(VisitSessionState previousState, VisitSessionState newState)

The method is called when the session status changes.

The previousState parameter is the previous status of the session. The type is visitSessionState.

The newState parameter is the new status of the session. Type - VisitSessionState.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.


Interface DepartmentListChangeListener

An interface whose methods are implemented by some application class. An object implementing the interface can be passed in the departmentListChangeListener parameter of the setDepartmentListChangeListener(DepartmentListChangeListChangeListener departmentListChangeListener) method of the MessageStream interface.

Used to track changes to the department list.

Method receivedDepartmentList(List<Department> departmentList)

The method is called when a new department list is received.

The departmentList parameter is the received department list. The type is List<[Department](#department)>.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.


Interface LocationSettings

The methods of the interface are implemented by internal SDK entities. An instance of a class that implements the interface can be retrieved using the getLocationSettings() method of the MessageStream object.

Specific settings for the current location can be retrieved using the methods of this interface.

Method areHintsEnabled()

With this method, can retrieve whether the current placement settings mandate showing hints to the visitor when typing a new message.

Does not accept parameters.

Returns a boolean value: true if hints should be shown, and false otherwise.

Does not throw exceptions.

Does not require any other methods to be called beforehand.


Interface ChatStateListener

An interface whose methods are implemented by some application class. An object implementing the interface can be passed in the listener parameter of the setChatStateListener(ChatStateListener listener) method of the MessageStream interface.

Used to track changes in the state of the current chat.

Method onStateChange(ChatState oldState, ChatState newState)

The method is called when the current chat state has changed.

The oldState parameter is the previous state of the chat. The type is ChatState.

The newState parameter is the new chat state. Type - ChatState.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.


Interface CurrentOperatorChangeListener

An interface whose methods are implemented by some application class. An object that implements the interface can be passed in the listener parameter of the setCurrentOperatorChangeListener(CurrentOperatorChangeListener listener)method of the MessageStream interface.

Used to track the change of the current chat operator.

Method onOperatorChanged(Operator oldOperator, Operator newOperator)

The method is called when the current chat operator has changed (or the operator is gone).

The oldOperator parameter is the previous operator. The type is Operator.

Parameter newOperator - new state of the chat. Type - Operator. Takes the value null in case the operator has left the chat.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.


Interface OperatorTypingListener

An interface whose methods are implemented by some class of the mobile application. An object of the class implementing the interface can be passed in the listener parameter of the setOperatorTypingListener(OperatorTypingListener listener) method of the MessageStream interface.

Used to notify when an operator starts typing a message.

Method onOperatorTypingStateChanged(boolean isTyping)

The method is called when the current chat operator has started typing a message.

The isTyping parameter is a boolean value that takes the value true if the operator is typing a message, and false otherwise.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.


Interface LocationSettingsChangeListener

An interface whose methods are implemented by some class of the mobile application. An object of the class implementing the interface can be passed in the locationSettingsChangeListener parameter of the setLocationSettingsChangeListener(LocationSettingsChangeListener locationSettingsChangeListener) method of the MessageStream interface.

Used to track changes to the current placement settings.

Method onLocationSettingsChanged(LocationSettings oldLocationSettings, LocationSettings, newLocationSettings)

The method is called when the current location settings have changed.

The oldLocationSettings parameter is the previous value of the current location settings. The type is LocationSettings.

The newLocationSettings parameter is the new value of the current location settings. Type - LocationSettings.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.


Interface OnlineStatusChangeListener

The interface is adapted by entities in the mobile application. A class object implementing the interface can be passed in the onlineStatusChangeListener parameter of the setOnlineStatusChangeListener(OnlineStatusChangeListener onlineStatusChangeListener) method of the MessageStream interface.

Used to receive notifications when the session status changes. The session status is described in values of enumerated type OnlineStatus.

Method onOnOnlineStatusChanged(OnlineStatus oldOnlineStatus, OnlineStatus newOnlineStatus)

The method is called when the session status changes.

The oldOnlineStatus parameter is the previous session status. The type is OnlineStatus.

Parameter newOnlineStatus - new (received) session status. Type - OnlineStatus.

Does not return anything.

Does not throw exceptions.

The method is called as a result of received notification from Rox.Chat service.


Interface UnreadByOperatorTimestampChangeListener

An interface whose methods are implemented by some class of the mobile application. An object of the class that implements the interface can be passed in the listener parameter of the setUnreadByOperatorTimestampChangeListener(UnreadByOperatorTimestampChangeListener listener) method of the MessageStream interface.

Method onUnreadByOperatorTimestampChanged(Date newTimestamp)

A method that is called when the parameter returned by the getUnreadByOperatorTimestamp() method changes.

The newTimestamp parameter is the new value returned by the getUnreadByOperatorTimestamp() method.

Does not return anything.

Does not throw exceptions.

The method is called as a result of received notification from Rox.Chat service.


Interface UnreadByVisitorMessageCountChangeListener

An interface whose methods are implemented by some class of the mobile application. An object of the class implementing the interface can be passed in the listener parameter of the setUnreadByVisitorMessageCountChangeListener(UnreadByVisitorMessageCountChangeListener listener) method of the MessageStream interface.

N.B.

The class object that implements the interface can only be retrieved after the session is started using the resume() method. This object increments the value of the number of unread messages by sending appropriate requests to the server every 30 seconds.

Method onUnreadByVisitorMessageCountChanged(int newMessageCount)

A method that is called when the parameter returned by the getUnreadByVisitorMessageCount() method changes.

The newMessageCount parameter is the new value returned by the getUnreadByVisitorMessageCount() method.

Does not return anything.

Does not throw exceptions.

The method is called as a result of received notification from Rox.Chat service.


Interface UnreadByVisitorTimestampChangeListener

An interface whose methods are implemented by some class of the mobile application. An object of the class implementing the interface can be passed in the listener parameter of the setUnreadByVisitorTimestampChangeListener(UnreadByVisitorTimestampChangeListener listener) method of the MessageStream interface.

Method onUnreadByVisitorTimestampChanged(Date newTimestamp)

A method that is called when the parameter returned by the getUnreadByVisitorTimestamp() method changes.

The newTimestamp parameter is the new value returned by the getUnreadByVisitorTimestamp() method.

Does not return anything.

Does not throw exceptions.

The method is called as a result of received notification from Rox.Chat service.


Interface Config

Method getId()

Use this method to get the id of the survey configuration.

Does not accept parameters.

Returns the configuration id. Type int.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getDescriptor()

Use this method to get the descriptor object for this survey.

Does not accept any parameters.

Returns an instance of the Descriptor class.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getVersion()

Use this method to get the version information of the current survey configuration.

Does not accept any parameters.

Returns the version number. Type String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.


Interface TokenCallback

An object that implements the interface can be passed in the tokenCallback parameter of the removePushToken(TokenCallback tokenCallback) method of the SessionBuilder class.

Method onSuccess()

The method is called if the call to the removePushToken(TokenCallback tokenCallback) method of the SessionBuilder class succeeds.

Does not accept parameters.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method onFailure(RoxError<TokenCallback> RoxError)

The method is called when the call to the removePushToken(TokenCallback tokenCallback) method of the SessionBuilder class fails.

The RoxError parameter is the error that occurred. The type is RoxError<TokenError>.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.


Enumerated type TokenError

Possible errors that can be passed to the RoxError parameter of the onFailure(RoxError<TokenError> RoxError) method of the TokenCallback interface.

Case SOCKET_TIMEOUT_EXPIRED

The waiting time for canceling the push token binding has expired.

Case UNKNOWN

The received error code is not supported by this version of Rox.Chat Mobile SDK.


Interface SessionCallback

An object that implements the interface can be passed in the callback parameter of the build(RoxSession.SessionCallback callback) method of the SessionBuilder class.

Method onSuccess()

The method is called when the call to the build(RoxSession.SessionCallback callback) method of the SessionBuilder class.

Does not accept parameters.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method onFailure(RoxError<SessionError> sessionError)

The method is called when the call to the build(RoxSession.SessionCallback callback) method of the SessionBuilder class.

Does not accept parameters.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.


enumerated type SessionError

Possible errors that can be passed to the sessionError parameter of the onFailure(RoxError<SessionError> sessionError) method of the SessionCallback interface.

case REQUEST_ERROR

An error occurred while sending an initialization request to the server.

case INVALID_PARAMETER_VALUE

A session parameter has an invalid value.

case UNKNOWN

The error code received is not supported by this version of Rox.Chat Mobile SDK.


Enumerated type AttachmentState

Used to determine the state of the file uploaded to the server (see the getState() method of the Attachment interface).

Case ERROR

An error occurred while uploading a file to the server. In this case, the getErrorType() method of the Attachment interface will contain the error type and the getErrorMessage() text.

Case READY

The file is available for download.

Case UPLOAD

The file is being uploaded to the server.


Enumerated type ChatState

Possible chat state options (see the getChatState() method of the MessageStream interface).

The initial state is NONE. If the startChat() method or one of the message sending methods of the MessageStream interface is called, the state changes to QUEUE. When the operator accepts a chat into processing, its (chat) state is changed to CHATTING. When the closeChat() method of the MessageStream interface is called, the state of the chat is changed to CLOSED_BY_VISITOR. If the chat was closed by an operator - to CLOSED_BY_OPERATOR. After the chat has been closed by both the visitor and the operator, its state returns to NONE. This also happens after a long time of no activity in the chat. The chat can also be restarted by the operator: in this case the chat state takes the value INVITATION, and after the visitor writes something back, the chat state takes the value CHATTING.

Case CHATTING

The chat state when either the operator has taken a visitor-initiated chat into processing, or when a visitor has responded to a message in a previously closed chat.

From this state, the chat can transition to either CLOSED_BY_OPERATOR, CLOSED_BY_VISITOR, or NONE.

Case CLOSED_BY_OPERATOR

The state of a chat room when it has been closed by an operator, but not yet closed by a visitor.

From this state, the chat can go to either NONE or QUEUE if the visitor writes something else.

Case CLOSED_BY_VISITOR

The state of the chat when it has been closed by the visitor, but not yet closed by the operator.

From this state, the chat can go to either NONE or QUEUE if the visitor writes something else.

Case INVITATION

The state of the chat when it was initiated by the operator.

From this state, the chat can go to either NONE or CHATTING.

Case NONE

Denotes the absence of chatting.

From this state, the chat can go to either INVITATION or QUEUE.

Case QUEUE

The state of the chat when it was initiated by a visitor.

From this state, the chat can go to either NONE, CHATTING, or CLOSED_BY_OPERATOR.

Case UNKNOWN

This state is received by chat when a session is created, before the first chat state update received from the server.

Also, this state can be received if the SDK cannot identify it (for example, the server has new chat state values that the current version of the SDK does not know how to handle).


Enumerated type DataMessageError

Possible errors that can be passed to the error parameter of the onFailure(Message.Id id, RoxError<DataMessageError> error) method of the DataMessageCallback interface.

Case UNKNOWN

The received error code is not supported by this version of Rox.Chat Mobile SDK.

Case QUOTED_MESSAGE_CANNOT_BE_REPLIED

The quoted message is not marked with the canBeReplied flag or the flag is not set to true

Case QUOTED_MESSAGE_FROM_ANOTHER_VISITOR

The message ID sent corresponds to another visitor.

Case QUOTED_MESSAGE_MULTIPLE_IDS

The sent message ID corresponds to multiple messages (most likely there is a database error).

Case QUOTED_MESSAGE_REQUIRED_ARGUMENTS_MISSING

Indicates that one or more arguments of the citation system implemented on the server were not sent.

Case QUOTED_MESSAGE_WRONG_ID

An invalid ID of the quoted message was sent.


Interface SearchMessagesCallback

An object implementing the interface can be passed in the searchMessagesCallback parameter of the searchMessages(String query, SearchMessagesCallback searchMessagesCallback) protocol MessageStream method.

Method onResult(List messages)

The method is called on successful result of calling method searchMessages(String query, SearchMessagesCallback searchMessagesCallback) of protocol MessageStream.

The messages parameter is a list of messages that were found as a result of the search query.

Does not return anything.

Does not throw exceptions.

Does not require calling any other methods beforehand. Type - List.


Interface SendKeyboardCallback

An interface whose methods are implemented by some application class.

An object obeying the interface can be passed in a parameter to the callback method sendKeyboardRequest(String requestMessageId, String buttonId, sendKeyboardCallback sendKeyboardCallback sendKeyboardCallback) of the MessageStream interface.

Method onSuccess(Message.Id id id)

The method is called when a message is successfully sent using the method sendKeyboardRequest(String requestMessageId, String buttonId, sendKeyboardCallback sendKeyboardCallback sendKeyboardCallback) of the MessageStream interface.

The id parameter is the ID of the corresponding message. The type is Message.Id.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

The method will be called after the sendKeyboardRequest(String requestMessageId, String buttonId, sendKeyboardCallback sendKeyboardCallback) method is completed.

Method onFailure(Message.Id id id, RoxError<SendKeyboardError> error)

Called when message sending fails using the sendKeyboardRequest(String requestMessageId, String buttonId, sendKeyboardCallback sendKeyboardCallback) method of the MessageStream interface.

The id parameter is the ID of the corresponding message. The type is RoxError.

The error parameter is the error that prevented the message from being sent successfully. The type is RoxError<SendFileError>.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

The method will be called after the method sendKeyboardRequest(String requestMessageId, String buttonId, sendKeyboardCallback sendKeyboardCallback) is completed.


Enumerated type DeleteUploadedFileError

Possible errors that can be passed to the error parameter of the onFailure(RoxError<DeleteUploadedFileError> error) method of the DeleteUploadedFileCallback interface.

Case FILE_NOT_FOUND

Indicates that the file is not found on the server.

Case FILE_HAS_BEEN_SENT

Indicates that the file is attached to a message and cannot be deleted.

Case UNKNOWN

Unknown error.


Enumerated type SendKeyboardError

Possible errors that can be passed to the error parameter of the onFailure(Message.Id id, RoxError<SendKeyboardError> error) method of the SendKeyboardCallback interface.

Case NO_CHAT

A key from the chatbot keyboard was sent to the wrong chat.

Case BUTTON_ID_NO_SET

Button ID is not set.

Case REQUEST_MESSAGE_ID_NOT_SET

The request message identifier is not set.

Case CAN_NOT_CREATE_RESPONSE

Unable to create a response.

Case UNKNOWN

Unknown error.


Enumerated type SendFileError

Possible errors that can be passed to the error parameter of the onFailure(Message.Id id, RoxError<SendFileError> error) method of the SendFilesCallback interface.

Case FILE_SIZE_EXCEEDED

Indicates that the file size exceeds the maximum size set in the server settings.

Case FILE_NOT_FOUND

The file selected for sending is not found on the device.

Case FILE_TYPE_NOT_ALLOWED

Indicates that the file type is not among the allowed types set in the server settings.

Case FILE_SIZE_TOO_SMALL

Indicates that the file is too small to upload.

Case MAX_FILES_COUNT_PER_CHAT_EXCEEDED

Indicates that the maximum number of files uploaded to chat has been exceeded.

Case UPLOADED_FILE_NOT_FOUND

Incorrect method of file transfer.

Case UNKNOWN

Unknown error.

Case UNAUTHORIZED

Unknown error.


Enumerated type SendFilesError

Possible errors that can be passed to the sendFilesError parameter of the onFailure(Message.Id id, RoxError<SendFileError> error) method of the SendFilesCallback interface.

Case FILE_NOT_FOUND

Indicates that the message does not contain a file.

Case MAX_FILES_COUNT_PER_MESSAGE

The message has exceeded the number of files to be sent in one message.

Case UNKNOWN

Unknown error.


Enumerated type State

Used to determine the state of the quoted message (see the getState() method of the Keyboard interface).

Case PENDING

Occurs when the keyboard is active and keys can be pressed.

Case CANCELLED

Occurs when the keyboard is inactive and keys cannot be pressed.

Case COMPLETED

Occurs when the keypad is inactive and one of the keys is selected.


Enumerated type RateOperatorError

Possible errors that can be passed to the error parameter of the onFailure(RoxError<RateOperatorError> rateOperatorError) protocol rateOperatorCallback method.

Case NO_CHAT

Occurs when attempting to send an operator rate when no chat exists.

Case OPERATOR_NOT_IN_CHAT

Occurs when an operator ID not belonging to the current chat was passed when trying to send an operator evaluation.


Enumerated type OnlineStatus

Possible session statuses.

Can be retrieved using the OnlineStatusChanged(OnlineStatus oldOnlineStatus, OnlineStatus newOnlineStatus) method of the OnlineStatusChangeListener interface.

Case BUSY_OFFLINE

Means that the visitor cannot send messages at all.

Case BUSY_ONLINE

Means that the visitor can send messages to the offline area, but the server may reject them and return an error.

Case OFFLINE

Means that the visitor can send messages to the offline zone.

Case ONLINE

Means that the visitor can send messages without any restrictions.

Case UNKNOWN

Indicates that either the SDK has not yet received the first session status update from the Rox.Chat service, or the session status is not supported in the current version of the SDK.


Enumerated type VisitSessionState

Possible session statuses.

Case CHAT

Chat status.

Case DEPARTMENT_SELECTION

Indicates that an attempt was made to start a chat without department selection, and the server is set to make department selection mandatory.

The session expects to start a chat using the startChatWithDepartmentKey(String departmentKey) method.

Case IDLE

Session is active, but chat has not been started yet.

Case IDLE_AFTER_CHAT

The session is active, but the chat has already been closed.

Case OFFLINE_MESSAGE

Offline.

Case UNKNOWN

Status has not yet been received or is not supported by the current version of the Rox.Chat Mobile SDK.


InterfaceMessageTracker

The interface is implemented by internal SDK entities. An instance of a class implementing the interface can be obtained using the newMessageTracker(MessageListener listener) method of the MessageStream interface.

Interface methods are used to manipulate messages that exist in the message history.

Method getLastMessages(int limit, getMessagesCallback callback)

The method is used to request messages from the beginning of the message history.

The limitOfMessages parameter is the number of next messages, no more than which the method should request. The type is int, the value can be any positive greater than 1 (if a value less than 1 is passed, the method will not do any work).

The callback parameter is an object of a class that implements the GetMessagesCallback interface.

Does not return anything.

Throws an illegalArgumentException if the value of the limit parameter is less than 1.

Throws an IllegalStateException if a previous similar request or getNextMessages(int limit, getMessagesCallback callback) request was not completed, or when the MessageTracker object has been deactivated (see destroy() method). destroy() method), or when the corresponding RoxSession object has been deactivated (see the destroy() method of the RoxSession interface).

Throws a RuntimeException if the method was called from a thread other than the thread in which the corresponding instance of RoxSession was created.

Does not require any other methods to be called beforehand.

The method may return the number of messages less than the limit, but this will not mean that there are no more messages left. In such a situation, the method can be reused to continue uploading messages. If there are no messages left, the method will return null.

Method getNextMessages(int limit, getMessagesCallback callback)

The method is used to request messages from the message history that are not yet displayed in the current message feed.

The limitOfMessages parameter is the number of next messages, no more than the method should request. The type is int, the value can be any positive greater than 1 (if a value less than 1 is passed, the method will not do any work).

The callback parameter is an object of a class that implements the GetMessagesCallback interface.

Does not return anything.

Throws an IllegalArgumentException if the value of the limit parameter is less than 1.

Throws an IllegalStateException if a previous similar request or getLastMessages(int limit, getMessagesCallback callback) request has not been completed, or when the MessageTracker object has been deactivated (see destroy() method). destroy() method), or when the corresponding RoxSession object has been deactivated (see the destroy() method of the RoxSession interface).

Throws a RuntimeException if the method was called from a thread other than the thread in which the corresponding instance of RoxSession was created.

Does not require any other methods to be called beforehand.

Method getAllMessages(GetMessagesCallback callback)

The method is used to query at once the entire message history stored on the device.

The callback parameter is an object of a class that implements the *GetMessagesCallback interface.

Does not return anything.

Throws an IllegalStateException if the MessageTracker object has been deactivated (see the destroy()method. method [destroy()](#message-tracker-destroy)), or when the corresponding [RoxSession](#rox-session) object has been deactivated (see the [destroy()](#destroy) method of the [RoxSession` interface).

Does not require any other methods to be called beforehand.

Method resetTo(Message message)

The MessageTracker object stores the current range of messages. A call to this method can "reset" the limit to which the object stores message history to a particular message.

The message parameter is the message to which the limit of the stored message history should be "reset". The type is Message.

Returns nothing.

Throws an IllegalStateException if the last request using the getNextMessages(int limit, getMessagesCallback callback) method has not been completed, or when the MessageTracker object has been deactivated (see destroy()#message) method. method [destroy()](#message-tracker-destroy)), or when the corresponding [RoxSession](#rox-session) object has been deactivated (see the [destroy()](#destroy)method of the [RoxSession` interface).

Throws a RuntimeException if the method was called from a thread other than the thread in which the corresponding instance of RoxSession was created.

Does not require any other methods to be called beforehand. The method can only be called after a previous call to the MessageTracker object has returned a result, otherwise the method will not do any work.

Method destroy()

Deactivates the current MessageTracker object, after which no interface methods can be used.

Does not accept parameters.

Does not return anything.

Throws an IllegalStateException when the MessageTracker object has been deactivated (see destroy()} method. method [destroy()](#message-tracker-destroy)), or when the corresponding [RoxSession](#rox-session) object has been deactivated (see the [destroy()](#destroy) method of the [RoxSession` interface)).

Throws a RuntimeException if the method was called from a thread other than the thread in which the corresponding instance of RoxSession was created.

Does not require any other methods to be called beforehand. Not required to be called.

Method loadAllHistorySince(Message sinceMessage, getMessagesCallback messagesCallback)

The method is used to request messages from the message history from the specified message.

The parameter sinceMessage is the message from which the history will be retrieved. The type is Message.

The messagesCallback parameter is an object of the class implementing the GetMessagesCallback interface.

Does not return anything.

Throws an IllegalStateException if a previous similar request or a loadAllHistorySince(Message sinceMessage, getMessagesCallback messagesCallback) request has not been completed, or when the MessageTracker object has been deactivated (see [destroy() method. method destroy()), or when the corresponding RoxSession object has been deactivated (see the destroy() method of the RoxSession interface).

Throws a RuntimeException if the method was called from a thread other than the thread in which the corresponding instance of RoxSession was created.

Does not require any other methods to be called beforehand.


Interface MessageListener

The Interface must be adapted by some application class. The methods of the Interface are called when changes are made to the message feed.

Method messageAdded(Message before, Message message)

The method is called when messages are added to the current feed.

Importantly, calling the method is not an indication that a new message has been received: it is a logical insertion of messages into the feed. For example, on the first successful connection to the server, the SDK retrieves the entire message history. If it contains messages that are in the time frame already displayed in the feed, this method will also be called on each such message.

The before parameter is the message before which the received message should be inserted. The type is Message. If the value of this parameter is null, the received message should be inserted at the end of the list.

Parameter message - received message. The type is Message.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method messageRemoved(Message message)

The method is called when a message is removed from the feed.

The message parameter is the deleted message. The type is Message.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method allMessagesRemoved()

The method is called when all messages are removed from the feed.

Does not accept any parameters.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method messageChanged(Message from, Message to)

The method is called when any message is changed.

Messages as such are not changed: one object is replaced by another. Therefore, when this method is called, you can compare the message fields to find out which ones are different.

The from parameter is the former message object. The type is Message.

The to parameter is the new message object. Type - Message.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.


Interface Message

The interface is an abstraction representing a single message within the SDK.

The interface is implemented by internal SDK entities, whose objects can be retrieved in method calls to the MessageListener interface.

The objects of Message are immutable. Changes to any of its fields create a new object. Two Message objects can be checked for field identity using the equals(Object obj) method. Logical correspondence of message objects can be checked by comparing their IDs (see the getID() method).

Method getAttachment()

Use this method to get an attachment if it is a file sent by a visitor or operator (Type FILE_FROM_OPERATOR or FILE_FROM_VISITOR).

Does not accept parameters.

Returns an instance of class MessageAttachment or null if the file is in the process of being sent.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getData()

Use this method to get an arbitrary dictionary generated by the server when Type ACTION_REQUEST is used.

Does not accept parameters.

Returns a dictionary of type String or null if it does not exist.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getId()

Use this method to get a unique message ID.

Does not accept any parameters.

Returns the ID of the message. The type is Message.Id.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getQuote()

Use this method to get information about the quoted message.

Does not accept parameters.

Returns an instance of the Quote class.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getKeyboard()

Use this method to get the chatbot's keyboard element ()Type Keyboard).

Does not accept parameters.

Returns an instance of the class Keyboard.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getKeyboardRequest()

This method retrieves the keyboard item that the user has selected.

Does not accept parameters.

Returns an instance of the class KeyboardRequest.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getOperatorID()

Use this method to get the ID of the operator that sent the message.

Does not accept any parameters.

Returns the operator ID or null if the message was not sent by an operator. The type is Operator.ID.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getSenderAvatarURL()

Use this method to get the URL to load the message sender's avatar (if any).

Does not accept parameters.

Returns the full URL of the message sender's avatar or null if there is no avatar. Type is String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getSenderName()

Use this method to get the name of the sender of a message.

Does not accept any parameters.

Returns the name of the sender of the message. The type is String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getSendStatus()

Use this method to get the send status of a message.

Does not accept parameters.

Returns a value of enumerated type SendStatus.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getSticker()

Use this method to get a sticker in a message.

Does not accept parameters.

Returns an instance of the class Sticker.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getText()

Use this method to get the text of a message.

Does not accept any parameters.

Returns the text of the message. The type is String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getTime()

Use this method to get the time the message was sent.

Does not accept any parameters.

Returns the number of milliseconds elapsed from the beginning of the epoch until the server processes the message. The type is long.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getType()

Use this method to get the type of the message.

Does not accept parameters.

Returns the value of the enumerated type Type.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method isEdited()

Use this method to find out if a message has been edited or not.

Does not accept any parameters.

Returns the status of the message. The type is Boolean.

Does not require any other methods to be called beforehand.


Interface Attachment

The interface is an abstraction representing a file attachment and its state in a message.

The interface is implemented by internal SDK entities. An Attachment object can be retrieved using the getAttachment() method of the Message interface.

Method getFileInfo()

A method that can be used to get information about a nested file.

Takes no parameters.

Returns a FileInfo object.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getFilesInfo()

A method that can be used to get information about attached files.

Takes no parameters.

Returns a list of FileInfo objects. The type is List.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getErrorType()

A method to get the type of error that caused problems loading a file.

Takes no parameters.

Returns the error type in text form. The type is String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getErrorMessage()

Method to get the text of the error that caused the file upload problem.

Does not accept parameters.

Returns the error text in text form. The type is String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getDownloadProgress()

A method to get the percentage of file download to the server.

Does not take any parameters.

Returns the percentage in integer form. The type is Int.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getState()

A method to get the state of a file uploaded to the server.

Does not take any parameters.

Returns an AttachmentState object.

Does not throw exceptions.


Interface FileInfo

The interface is an abstraction representing a file attachment in a message.

The interface is implemented by internal SDK entities. A FileInfo object can be retrieved using the getFileInfo() method of the Attachment interface.

Method getContentType()

A method that can be used to get the MIME type of an attachment.

Takes no parameters.

Returns the MIME type of the attachment in text form. The type is String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getFileName()

A method that can be used to get the file name of an attachment.

Does not take any parameters.

Returns the name of the attachment file in text form. The type is String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getImageInfo()

A method that can be used to get information about an image, if the attachment is one.

Takes no parameters.

Returns an object ImageInfo or null if the attachment is not an image.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getSize()

A method that can be used to get the size of the attachment file.

Does not take any parameters.

Returns the size of the attachment file in bytes. The type is long.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getUrl()

A method that can be used to get a link to download the attachment file. The link is valid only for the current session.

Takes no parameters.

Returns the URL of the attachment file. The type is String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.


Interface ImageInfo

The interface is an abstraction representing information about an attachment if it is an image. The interface is adapted by internal SDK entities.

The ImageInfo object can be retrieved using the getImageInfo() method of the Attachment interface.

Method getThumbUrl()

The method retrieves the URL to download a preview of an image. The maximum vertical and horizontal dimensions are 300 pixels, but can be changed on the server. In order to know the exact size of the preview until the image is downloaded yet, you can use the following code:

int THUMB_SIZE = 300;
  int width = imageInfo.getWidth();
  int height = imageInfo.getHeight();
  if (height > width) {
      width = (THUMB_SIZE * width) / height;
      height = THUMB_SIZE;
  } else {
      height = (THUMB_SIZE * height) / width;
      width = THUMB_SIZE;
  }

Takes no parameters.

Returns the URL to download a preview of the image in text form. The type is String. The resulting link is valid only for the current session.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getHeight()

A method that can be used to get the height of an image.

Does not take any parameters.

Returns the height of the image in pixels. The type is Int.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getWidth()

A method that can be used to get the width of an image.

Does not take any parameters.

Returns the width of the image in pixels. The type is Int.

Does not throw exceptions.

Does not require any other methods to be called beforehand.


Enumerated type MessageType

Used to define the message type (see the getType() method of the Message interface).

Case ACTION_REQUEST

A message containing a dictionary of arbitrary data to be processed by the application based on client-defined logic (see the getData() method of the Message interface).

Case CONTACT_REQUEST

A message asking the operator to leave their contact information.

Case FILE_FROM_OPERATOR

A file sent by the operator.

Case FILE_FROM_VISITOR

A file sent by a visitor.

Case INFO

A system message automatically generated on the server (such as a greeting at the beginning of a chat).

Case KEYBOARD

A message sent by a chatbot.

Case KEYBOARD_RESPONSE

A message from the chatbot containing information about the button the user has selected.

Case OPERATOR

A text message from the operator.

Case OPERATOR_BUSY

A system message indicating that the operator is currently busy.

Case VISITOR

A text message from a visitor.


Enumerated type SendStatus

Used to determine the sending status of a message (see the getSendStatus() method of the Message interface).

Case SENDING

Indicates any state of the message until it has been received, processed, and sent to all recipients by the server.

Case SENT

Indicates any state of the message after the events listed in the SENDING description.


Interface Department

A representation of a single department. Provides methods to retrieve information about a department.

Department objects can be retrieved using a class that implements the DepartmentListChangeListener interface, or as a result of calling the getDepartmentList() method of the MessageStream protocol.

Method getKey()

A department key is required to start a chat with a specific department (method startChatWithDepartmentKey(String departmentKey) of the MessageStream protocol).

Accepts no parameters.

Returns the department key. The type is String.

Does not throw any exceptions.

Does not require any other methods to be called beforehand.

Method getName()

Takes no parameters.

Returns the public name of the department. The type is String.

Does not throw any exceptions.

Does not require any other methods to be called beforehand.

Method getDepartmentOnlineStatus()

Does not take any parameters.

Returns the online status of the department. The type is DepartmentOnlineStatus.

Does not throw any exceptions.

Does not require any other methods to be called beforehand.

Method getOrder()

Takes no parameters.

Returns a number representing the output order of the department in the list. A higher number indicates a higher priority to output the department in the list. Type is int.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getLocalizedNames()

Takes no parameters.

Returns a dictionary of localized department names or null. The type is Map<String, String>. The key is the locale name, the value is the department name corresponding to the locale.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getLogoUrl()

Takes no parameters.

Returns the URL of the department logo or null. The type is URL.

Does not throw any exceptions.

Does not require any other methods to be called beforehand.


Enumerated type DepartmentOnlineStatus

Possible statuses of the department.

Can be obtained by calling the getDepartmentOnlineStatus()method of the Department protocol.

Case BUSY_OFFLINE

Offline, chat status exceeded.

Case BUSY_ONLINE

Online, chat status exceeded.

Case OFFLINE

The visitor can send offline messages.

Case ONLINE

The visitor can send online messages.

Case UNKNOWN

The current status is not supported by this version of Rox.Chat Mobile SDK*.


Interface Operator

The object of the class that implements the interface is an abstract representation of each specific chat operator. The interface is implemented by internal SDK entities.

Interface objectsOperator can be obtained in the interface methods CurrentOperatorChangeListener and getCurrentOperator() MessageStream.

Method getId()

The method allows you to get the ID of a specific operator.

Does not accept parameters.

Returns the ID of a specific operator. The type is Operator.Id.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getName()

The method allows you to get the name of a specific operator.

Does not take any parameters.

Returns the name of a specific operator. The type is String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getAvatarUrl()

Method retrieves the URL to download a particular operator's avatar (if any).

Does not take any parameters.

Returns the URL for downloading a particular operator's avatar, or null if there is none. The type is String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Interface RoxPushNotification

The RoxPushNotification object is an abstract representation of a specific push notification received by an application from the Rox.Chat service.

The interface is implemented by internal SDK entities. The RoxPushNotification objects can be obtained using the parseGcmPushNotification(Bundle bundle) method of the Rox.Chat class.

Method getType()

Use this method to specify useful information of a specific RoxPushNotification object.

Takes no parameters.

Returns the value of an enumerated type NotificationType.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getEvent()

Use this method to specify an intended action that involves receiving this particular RoxPushNotification object.

Takes no parameters.

Returns add (add the information contained in this push notification) or del (add the information contained in this push notification). The type is String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getParams()

Use this method to specify the payload of a particular RoxPushNotification object, depending on its type and contained in an array.

Takes no parameters.

Returns List<String>. See the enumerated type description NotificationType for possible array contents.

Does not throw exceptions.

Does not require any other methods to be called beforehand.


Enumerated type NotificationType

Type values indicate the type of useful information comprising a particular push notification - can be retrieved using the getType() method of the RoxPushNotification interface.

Case CONTACT_INFORMATION_REQUEST

Indicates the event when the operator sent a visitor a request for contact information.

The parameter dictionary (see the getParams() method of the RoxPushNotification interface) is empty in this case.

Case OPERATOR_ACCEPTED

Indicates the event when an operator has joined the chat room.

The parameter dictionary (see the getParams() method of the RoxPushNotification interface) contains only one value in this case, the operator name.

Case OPERATOR_FILE

Indicates the event when the operator sent a file to the chatroom.

The parameter dictionary (see the getParams() method of the RoxPushNotification interface) in this case contains two values - operator name and file name.

Case OPERATOR_MESSAGE

Indicates the event when the operator sent a message to the chatroom.

The parameter dictionary (see the getParams() method of the RoxPushNotification interface) in this case contains two values - operator name and message text.

Case WIDGET

Indicates the event when the operator sent a widget message (this functionality is not supported by default, you should contact support to support it).

The parameter dictionary (see the getParams() method of the RoxPushNotification interface) is empty in this case.


Interface FatalErrorHandler

The interface is implemented by the client application classes. Methods of the class that implements the interface are called when it is necessary to handle errors that the Rox.Chat service may return during operation. See the enumerated type FatalErrorType for error descriptions.

Method onError(RoxError<FatalErrorType> error)

Called when a fatal error occurs in the Rox.Chat service.

Parameters error - fatal error of Rox.Chat service. The type is `RoxError``.

It does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.


Enumerated type FatalErrorType

Corresponds to the values of possible fatal errors that may occur in the Rox.Chat service (see the getErrorType() method of the RoxError interface).

Case ACCOUNT_BLOCKED

Indicates that the client's account in Rox.Chat service is blocked (for example, for non-payment).

The occurrence of the error does not depend on the visitor's actions, and the possible behavior of the application in case of this error is presented as a suggestion to the visitor to try to use the chat later.

Case PROVIDED_VISITOR_EXPIRED

Indicates that the user data provided when creating the session (cf. methods setVisitorFieldsJson(String visitorFieldsJson) and setVisitorFieldsJson(JsonObject visitorFieldsJson) of classSessionBuilder) are no longer valid.

The proposed application behavior is to generate new user data and create a new session instance.

Case UNKNOWN

Indicates the occurrence of some unexpected and undocumented error.

Case VISITOR_BANNED

Occurs when a user with passed data (cf. methods setVisitorFieldsJson(String visitorFieldsJson) and setVisitorFieldsJson(JsonObject visitorFieldsJson) of class SessionBuilder) was blocked by the operator for some reason.

Case WRONG_PROVIDED_VISITOR_HASH

Indicates an error in generating user data. Does not depend on user actions, but signals an error in the application's data generation algorithm.


Interface NotFatalErrorHandler

The interface is implemented by the client application classes. Methods of the class that implements the interface are called when necessary to handle errors that the Rox.Chat service may return during operation. For descriptions of errors, see the enumerated type values NotFatalErrorType.

Method onNotFatalError(RoxError<NotFatalErrorType> error

Called when a non-fatal error occurs in the Rox.Chat service.

The error parameter is a non-fatal error of the Rox.Chat service. The type is RoxError.

It does not return anything.

Does not throw exceptions.

Does not require calling any other methods beforehand.


Enumerated type NotFatalErrorType

Corresponds to the values of possible fatal errors that may occur in the Rox.Chat service (see the getErrorType() method of the RoxError interface).

Case NO_NETWORK_CONNECTION

This error indicates that there is no network connection.

Case SOCKET_TIMEOUT_EXPIRED

This error occurs when the server is unavailable or there is another cause for a SocketTimeoutException exception.


Interface RoxError

The interface is implemented by internal SDK entities. The RoxError objects are passed to the error parameter of the onError(RoxError<FatalErrorType> error) method of the FatalErrorHandler interface.

The interface methods are designed to handle fatal errors that may occur when working with the Rox.Chat service.

Method getErrorType()

The method is designed to get the specific type of error that occurred.

Does not accept parameters.

Returns the value of the corresponding Type type.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getErrorString()

The method can be called to get a textual representation of the error that occurred.

It does not take any parameters.

Returns the textual representation of the error that occurred. The type is String.

Does not throw exceptions.

Does not require calling any other methods beforehand.


Interface RoxLog

Interface that provides methods to implement "logging" of network activity of Rox.Chat Mobile SDK.

The mechanism can be useful, for example, when "debugging" "production" releases where no "debug" logs are available.

Method log(String log)

A method that is called automatically when a new entry for the Rox.Chat Mobile SDK network activity log is released.

The log parameter is the new entry for the log. The type is String.

Does not return anything.

Does not throw exceptions.

Does not require calling any other methods beforehand.


Returned HTTP Error Codes

Category Error code Meaning and possible way to solve it
General errors
account-blocked The client's account in the Rox.Chat service is blocked (for example, for non-payment). Please contact the Rox.Chat service technical support for assistance
chat-required Responding to an action in chat without chat
content_type_not_recognized The MIME type of the attachment is not recognized. Check if the file you are sending is damaged. Also make sure that the contents of the file match one of the MIME types
connection-timeout The connection timeout is up. Check the network configuration
domain-not-from-whitelist Domain not in whitelist
incorrect-file-name Incorrect file name. It may be too long or contain invalid special characters
max_file_size_exceeded The size of the uploaded file is too large. Try reducing the file size or increasing the weight limit for uploaded files
file_size_too_small The size of the file being uploaded is too small. You may be trying to upload an empty file
not_allowed_file_type Uploading a file of this format is prohibited or not supported. Change the parameter responsible for the file types allowed for uploading in the server settings
not_allowed_mime_type Uploading a file of this MIME type is prohibited or not supported. Change the parameter responsible for the MIME file types allowed for uploading in the server settings
no_previous_chats Previous chats are missing
not_matching_magic_numbers The magic numbers don't match
max_files_count_per_chat_exceeded The maximum number of files sent to one chat room has been reached
provided-visitor-expired The user data presented when the session was created is no longer valid. This error is resolved automatically by reinitialization
reinit-required Reinitialization is required - most likely the AuthToken is out of date. This error is resolved automatically by reinitialization
setting_disabled The requested setting is disabled
server-not-ready The server is not ready to respond to the request. This error appears when you try to access the server before it is fully powered on. Try waiting a little longer
session_not_found The session you are looking for was not found
unathorized Unauthorized access attempted. Authorization required
uploaded-file-not-found Uploaded file not found
visitor_banned The visitor was blocked by the operator
wrong-argument-value The error occurs when the server receives a request with an incorrect argument type (e.g. String instead of int)
wrong-provided-visitor-hash-value Error occurs when attempting to authorize a visitor with invalid signature
Errors of quoting messages in chat
quoting-message-that-cannot-be-replied The message cannot be quoted - it is not marked with the canBeReplied flag or the flag is not set to true value
quoting-message-from-another-visitor The message ID sent corresponds to another visitor
corrupted-quoted-message-id Invalid ID of the quoted message
multiple-quoted-messages-found The message ID sent corresponds to multiple messages (most likely there is a database error)
quoted-message-not-found The ID sent does not match any message in the database
required-quote-args-missing One or more arguments of the citation system implemented on the server were not sent
Authentication errors
provided-auth-token-not-found Authentication token not found on the server. This error occurs only in case of using custom client authentication mechanism via token. Most likely, the token has not yet reached the Rox.Chat service from the client server and you need to wait a little longer
Errors related to sending, editing and deleting messages
message_empty Attempt to send an empty message
max-message-length-exceeded The maximum allowable message length has been reached
message_not_found Message with the ID you are looking for was not found
not_allowed The ability to edit/delete messages is disabled on the server
message_not_owned The visitor is trying to edit/delete an operator message or the specified identifier belongs to another message
wrong_message_kind A visitor tries to edit a non-text message
Agent rate errors
no-chat The error occurs in the following cases:

  • When attempting to send an operator evaluation when the chat does not exist
  • When attempting to send a key press to the bot when the chat does not exist
  • When sending a message to the visitor when the chat does not exist and in the account configuration the value of the property force_start_chat_on_visitor_message is false
operator-not-in-chat Occurs when an operator ID not belonging to the current chat was passed when trying to send an operator assessment
note-is-too-long The maximum comment length limit of 2000 characters has been exceeded
Keyboard response errors
button-id-not-set Button ID is not set
requset-message-id-not-set The request message identifier is not set
can-not-create-response Unable to create a reply
Errors of sending dialogs by e-mail
chat-history-sent-too-many-times Chat history has been sent too many times
File deletion errors
file-has-been-sent The file is attached to the message and cannot be deleted
file-not-found File not found