METHOD_PC_SearchRooms
This method sends a request to
BEMS
to search for group discussions.The following table lists the parameters that you can include in this method.
Parameter | Type | Required | Description |
---|---|---|---|
searchTerm | String | √ | This parameter specifies the search term that is used to search group discussionnames and optionally the group discussions descriptions. |
searchDesc | Boolean | — | This parameter specifies whether to search for group discussions using the name and description. By default, this value is true.
|
isMemberOf | Boolean | — | This parameter specifies the list of group discussions that the user is a member of. By default, this value is false and the search query includes group discussions that the member is and isn't a member of. |
disabled | Boolean | — | This parameter specifies whether to include disabled group discussions in a search. By default, this value is false.
|
privacy | String Array | — | This parameter specifies the security level of the group discussion and if the group discussions are returned in a search. By default, this value is set to all. All of the privacy settings for group discussions are searched. Group discussions with the privacy set to Secret are only returned in the search query if the user is a member of the group discussion. |
BEMS response and notification
BEMS
response and notificationThe following table describes the parameters that
BEMS
returns and the notification to send to the BlackBerry Connect
app when users search for a group discussion. Parameter | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Rooms | Json Array | This parameter specifies the array of group discussions that meet the search request parameters. The following information is included for each group discussion.
|
Code example
The following example sends a request to
BEMS
to search for the retirement celebration group discussion using the search term "potluck" . The search searches closed and secret group discussions. Group discussions that are disabled are not included in the search.{ "method":"pc.SearchRooms", "params": { "searchTerm":"potluck", "disabled":true, "privacy":["Closed","Secret", "Open"] }, "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.SearchRooms", "state":"PROCESSING" } }, "jsonrpc":"2.0" }
If there are no errors,
BEMS
sends the following notification to the BlackBerry Connect
app and displays the group discussions that match the search query. In this example, one group discussion with 15 participants matches the search query.{ "id":"c5", "error":null, "result": { "data": { "method":"pc.SearchRooms", "rooms": [ { "id":"ma-chan://gems.example.com/25ac15e7-9bff-4e78-9261-6e08aa43231e", "name":"Retirement celebration discussion", "description":"Discuss potluck options", "numberOfParticipants":15 } ] } }, "jsonrpc":"2.0", "state": "COMPLETE" }