Calls / React Native
Calls React Native v1
Calls React Native
Calls
React Native
Home
/
Calls
/
React Native
/
Group call

Retrieve a list of rooms

You can retrieve a list of rooms by using the RoomListQuery and the following table shows all supported filters for the RoomListQuery to search for specific rooms you want to retrieve.

Property nameTypeDescription

limit

number

Filters query results to include the specified the number of results to return per page.

roomIds

string[]

Filters query results to include the specified unique identifiers for the rooms.

state

RoomState

Filters query results to include room with the specified room state.

currentParticipantCount

Range

Filters query results to include rooms with the specified range of numbers for current participants.

createdByUserIds

string[]

Filters query results to include rooms that were created by specified user IDs.

createdAt

Range

Filters query results to include rooms that were created between the specified range of time.

You can specify the above filters as shown below:

try {
  const roomListQuery = await SendbirdCalls.createRoomListQuery({
    type: SendbirdCalls.RoomType.SMALL_ROOM_FOR_VIDEO,
    limit: 50,
    state: SendbirdCalls.RoomState.OPEN,
    currentParticipantCount: { lowerBound: 1, upperBound: 10 },
    createdByUserIds: ['USER_ID1'],
    createdAt: { upperBound: Date.now() },
  });
  const rooms = await roomListQuery.next();
} catch (e) {
  // Error has occurred.
}