# Room

## Create Room

```php
function createRoom(string $name, bool $isPublic = false, array $invitees = [])
```

Parameters:

| Name     | Type         | Description                 | Required |
| -------- | ------------ | --------------------------- | -------- |
| name     | string       | room name                   | true     |
| isPublic | string       | public or private           | false    |
| invitees | string array | array of user ids to invite | false    |

Returns:

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| room | Room | Room Object | true     |

## Join Room

```php
function joinRoom(string $roomIdOrAlias)
```

Parameters:

| Name          | Type   | Description      | Required |
| ------------- | ------ | ---------------- | -------- |
| roomIdOrAlias | string | room id or alias | true     |

Returns:

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| room | Room | Room Object | true     |

## Get Room Object

```php
function getRoom(string $roomId)
```

Parameters:

| Name   | Type   | Description | Required |
| ------ | ------ | ----------- | -------- |
| roomId | string | room id     | true     |

Returns:

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| room | Room | Room Object | true     |

## Invite User

```php
function inviteUser(string $userId)
```

Parameters:

| Name   | Type   | Description | Required |
| ------ | ------ | ----------- | -------- |
| userId | string | user id     | true     |

Returns: none

## Kick User

```php
function kickUser(string $userId)
```

Parameters:

| Name   | Type   | Description | Required |
| ------ | ------ | ----------- | -------- |
| userId | string | user id     | true     |

Returns: none

## Leave Room

```php
function leave()
```

input params：none

Returns: none

## Get Room Memebers

```php
 function getJoinedMembers()
```

Parameters: none

Returns:

| Name           | Type             | Description      | Required |
| -------------- | ---------------- | ---------------- | -------- |
| roomMemberInfo | array of members | room member info | true     |

## Send Message

```php
function sendText(string $text)
```

Parameters:

| Name | Type   | Description     | Required |
| ---- | ------ | --------------- | -------- |
| text | string | message to send | true     |

Returns:

| Name    | Type   | Description | Required |
| ------- | ------ | ----------- | -------- |
| eventId | string | event id    | true     |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sending-network.gitbook.io/sending.network/sdk-documentation/php-sdk/room.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
