METHOD_PC_FollowRooms
This method sends a request to BEMS to follow or unfollow a discussion room. When users follow a group discussion, they automatically join the group discussion and can participate in and receive events associated with the group discussion.
The following table describes the parameters that you can include in this method.
|
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
roomsToFollow |
String Array |
—* |
This parameter specifies a list of group discussion IDs that users can follow and participate in. |
|
roomsToUnfollow |
String Array |
—* |
This parameter specifies a list of group discussion IDs that users can unfollow. When users unfollow a group discussion they stop receiving notifications from the group discussion. |
|
replaceList |
Boolean |
√ |
This parameter specifies one of the following actions:
|
* If replaceList is true, then the roomsToFollow is required and roomsToUnfollow should not be passed in. If replaceList is false, either the roomsToFollow or roomsToUnfollow parameter must be passed in.
Code example
The following example sends a request to BEMS to follow and unfollow specified group discussions.
{
"method":"pc.FollowRooms",
"params":
{
roomsToFollow:[
"ma-chan://gems.example.com/25ac15e7-9bff-4e78-9261-6e08aa43231e",
"ma-chan://gems.example.com/d19de8b1-469c-4a92-a8c0-f5e37ba62db6"
],
roomsToUnfollow:[
"ma-chan://gems.example.com/f7972fdb-7ea9-4d7f-be4c-d27c8d9c44bc",
"ma-chan://gems.example.com/a15593ae-3a4e-414c-b33f-deb077136362"
],
replaceList: true
},
"id":"c5",
"jsonrpc":"2.0"
}
If the request is successful, BEMS sends the following response to the BlackBerry Connect app and processes the request.
{
"id":"c5",
"error":null,
"result":
{
"data":
{
"method":"pc.FollowRooms",
"state":"PROCESSING"
}
},
"jsonrpc":"2.0"
}
If there are no error messages, BEMS sends the following notification to the BlackBerry Connect app and the user follows and unfollows the specified group discussions.
{
"id":"c5",
"sequence":1018829700000047,
"result":
{
"data":
{
"method":"pc.FollowRooms",
"state":"COMPLETE"
}
},
"jsonrpc":"2.0"
}