Skip Navigation

METHOD_Ping

This method reports the state and status of 
BEMS
.
The following table describes the parameters that you can include in this method.
Parameter
Type
Required
Description
dependencies
String
This parameter specifies other methods that this method is dependent on. It specifies the comma delimited dependent request IDs.
reconnect
String
This parameter specifies that the 
BlackBerry Connect
 app re-establish the existing session. For example, if 
BlackBerry Connect
 goes to the background, when it comes to the foreground the same session is continued. 

BEMS
 response and notification 

The following table describes the parameters that 
BEMS
 returns and the notification that is sent to the 
BlackBerry Connect
 app when it receives a request for its state and status.
Parameter
Type
Description
method
String
This parameter specifies the method invoked (for example, Ping). 
state
String
This parameter specifies the state of the request to 
BEMS
 (for example, Processing or Complete). 
sessionTimeout
Integer
This parameter specifies the time when the when the session times out. By default, the sessionTimeout is set to 86400 seconds (24 hours). 

Example code 

The following example sends a request to 
BEMS
 to send its state and statistic information.
{ "method":"Ping", "params":{}, "id":"c58", "jsonrpc":"2.0" }
If the request is successful, 
BEMS
 sends the following response to the 
BlackBerry Connect
 app and processes the request.
{ "id":"c58", "error":null, "result": { "data": { "sessionTimeout":86400, "method":"Ping", "state":"PROCESSING" } }, "jsonrpc":"2.0", "background":false }
If there are no errors, 
BEMS
 sends the following notification of the 
BEMS
 state and statistics.
{ "id": "c58", "sequence":1018682300000045, "result": { "data": { "sessionTimeout":86400, "method":"Ping", "state":"COMPLETE" } }, "jsonrpc":"2.0", }