Skip Navigation

METHOD_AcceptChat

This method allows the 
BlackBerry Connect
 app to accept a chat request from a contact and start a conversation. 
The following table describes the parameters that you can include in this method.
Parameter
Type
Required
Description
requestId
String
This parameter specifies the requestId from the InvitationReceived server notification.
dependencies
String
This parameter specifies the other methods that this method is dependent on. 

BEMS
 response and notification

The following table describes the response and notification parameters that 
BEMS
 returns when the chat is requested and accepted.
Parameter
Type
Description
chatId
String
This parameter returns the requestId of the chat.
method
String
This parameter returns the invoked method (for example, AcceptChat). 
state
String
This parameter specifies the state of the request to 
BEMS
 (for example, Processing or Complete).

Code example

The following example sends a request to 
BEMS
 to accept an instant messaging chat request.
{ "method":"AcceptChat", "params": { "requestId":"dbc2e7b6-25e8-450e-9670-c9e4f32341bb" }, "id":"c5", "jsonrpc":"2.0" }
If the request is successful, 
BEMS
 returns the following response to the 
BlackBerry Connect
 app and processes the request.
{ "id":"c5", "error":null, "result": { "data": { "chatId":"dbc2e7b6-25e8-450e-9670-c9e4f32341bb", "method":"AcceptChat", "state":"PROCESSING" } }, "jsonrpc":"2.0", "background":true }
If there are no errors, 
BEMS
 sends the following notification to the 
BlackBerry Connect
 app and the chat is started.
{ "id":"c5", "sequence":1018540600000022, "result": { "data": { "chatId":"dbc2e7b6-25e8-450e-9670-c9e4f32341bb", "method":"AcceptChat", "state":"COMPLETE" } }, "jsonrpc":"2.0" }