Room
RoomService API
Get the roomService object through a login session
Create a one-on-one private chat room
Establishes a private chat room between two users.
Input parameter:
Name | Type | Description | Required |
---|---|---|---|
otherUserId | string | ID of the other participant | true |
Output parameter:
Type | Description | Required |
---|---|---|
string | ID of the chat room | true |
Create a general chat room
Input parameter:
Name | Type | Description | Required |
---|---|---|---|
createRoomParams | CreateRoomParams | Parameters for room creation | true |
CreateRoomParams:
Name | Type | Description |
---|---|---|
name | string | Name of the room |
topic | string | Topic of the room |
avatarUri | Uri | URI for room avatar |
invitedUserIds | string array | IDs of users to invite |
preset | CreateRoomPreset | Specific room privacy settings |
CreateRoomPreset:
Value | Description |
---|---|
PRESET_PUBLIC_CHAT | Public room, joinable without an invitation |
PRESET_PRIVATE_CHAT | Private room, joinable by invitation only |
PRESET_TRUSTED_PRIVATE_CHAT | Private room, intended for one-on-one chats |
Output parameter:
Type | Description | Required |
---|---|---|
string | Room ID | true |
Join a room
Join an existing room.
Input parameter:
Name | Type | Description | Required |
---|---|---|---|
roomId | string | Room ID | true |
reason | string | Reason for joining | false |
viaServers | string array | array of node domains | false |
Output parameter:
Type | Description | Required |
---|---|---|
string | Room ID | true |
Leave a room
Leave an existing room.
Input parameter:
Name | Type | Description | Required |
---|---|---|---|
roomId | string | Room ID | true |
reason | string | Reason for leaving | false |
Output parameter: None
Create a private chat Room with a wallet address
If a room already exists, it returns the existing room ID. If no room exists, a new room is created.
Input Parameter:
Name | Type | Description | Required |
---|---|---|---|
address | String | Target user's wallet address | true |
Output parameter:
Type | Description | Required |
---|---|---|
String | ID of the room | true |
Delete a Room
This method allows the room owner to delete a room. Optional deletion reason can be provided.
Input Parameter:
Name | Type | Description | Required |
---|---|---|---|
roomId | String | ID of the room | True |
reason | String | Reason for deletion | False |
Output parameter: None
RoomPushRuleService API
Get RoomPushRuleService object via Room object
Set Room Notification State
Modify the notification settings for a room.
Input parameter:
Name | Type | Description | Required |
---|---|---|---|
roomNotificationState | RoomNotificationState | Notification state | true |
RoomNotificationState values:
Value | Description |
---|---|
ALL_MESSAGES | Notify for all messages |
MENTIONS_ONLY | Notify only for mentions |
MUTE | Disable notifications |
Output parameter: None
Get room notification state
Get the current notification state of a room.
Input parameter: None
Output parameter:
Type | Description | Required |
---|---|---|
RoomNotificationState | Notification state | true |
TagService API
Get TagService object via Room object
Add a room tag
Add a tag to a room with optional order.
Input parameter:
Name | Type | Description | Required |
---|---|---|---|
tag | string | Name of the tag | true |
order | double | Room Position, assigned a value from 0 to 1; lower values indicates higher priority. | false |
Output parameter: None
Delete a Tag
Remove a tag from a room.
Input parameter:
Name | Type | Description | Required |
---|---|---|---|
tag | string | Name of the tag | true |
Output parameter: None
SendService API
Get SendService object via room object
Send a text message
Send a text message to a room.
Input parameter:
Name | Type | Description | Required |
---|---|---|---|
text | string | The content of the message | true |
msgType | string | The type of message, default is text | true |
autoMarkdown | boolean | Enable Markdown formatting, default is false | true |
additionalContent | Content | Additional message content | false |
Output parameter:
Type | Description | Required |
---|---|---|
Cancelable | A cancelable object | true |
Send media file
Send a media file to a room.
Input parameter:
Name | Type | Description | Required |
---|---|---|---|
attachment | String | the media to send | true |
compressBeforeSending | String | set to true to compress images before sending them | True |
roomIds | String | set of roomIds to where the media will be sent. The current roomId will be add to this set if not present. | True |
rootThreadEventId | String | when this param is not null, the Media will be sent in this specific thread | True |
relatesTo | String | add a relation content to the media event | True |
additionalContent | String | additional content to put in the event content | True |
Output parameter:
Type | Description | Required |
---|---|---|
Cancelable | A cancelable object | true |
LocationSharingService API
Get LocationSharingService object via Room object
Send static location message
Share a static location in a room.
Input parameter:
Name | Type | Description | Required |
---|---|---|---|
latitude | double | Latitude coordinate | true |
longitude | double | Longitude coordinate | true |
uncertainty | double | Location accuracy in meters | false |
isUserLocation | boolean | Indicates if the location is the user's current or a pinned location | true |
Output parameter:
Type | Description | Required |
---|---|---|
Cancelable | A cancelable object | true |
Send live location message
Share a live location update in a room.
Input parameter:
Name | Type | Description | Required |
---|---|---|---|
beaconInfoEventId | string | Event ID of the initial beacon info state event | true |
latitude | double | Latitude coordinate | true |
longitude | double | Longitude coordinate | true |
uncertainty | double | Location accuracy in meters | false |
Output parameter:
Type | Description | Required |
---|---|---|
Cancelable | A cancelable object | true |
Last updated