METHOD_MoveContact

This method sends a request to BEMS to move a contact from one group to another group.

The following table describes the parameters that you can include in this method.

Parameter

Type

Required

Description

contactId

String

√

This parameter specifies the contact ID of the contact to move between groups.

fromGroupId

String

√

This parameter specifies the group ID that the contact exists in.

toGroupId

String

√

This parameter specifies the group ID of the group that the contact is moving to.

dependencies String — This parameter specifies the 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 a contact is moved between groups.

Parameter

Type

Description

state

String

This parameter specifies the state of the request to BEMS (for example, Processing or Complete).

method String This parameter specifies the method invocation name (for example, MoveContact).
message String This parameter specifies the message that is sent to the BlackBerry Connect app.

Example code

The following example sends a request to BEMS to move a contact to a different group in the contacts list.

{
 "method":"MoveContact",
 "params":
   {
     "contactIds":"user1@example.com",
     "fromGrouId":"2",
     "toGroupId":"1"
   },
 "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":
     {
       "method":"MoveContact",
       "state":"PROCESSING"
     }
   },
 "jsonrpc":"2.0",
 "background": false
}

If there are no errors, BEMS sends the following notification to the BlackBerry Connect app and the contact is moved to the specified group.

{
  "id":"c58",
  "sequence":1018547700000027,
  "result":
   {
     "data":
     {
       "method":"MoveContact",
       "state":"COMPLETE"
     }
   },
 "jsonrpc":"2.0",
}