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:
otherUserId
string
ID of the other participant
true
Output parameter:
string
ID of the chat room
true
Create a general chat room
Input parameter:
createRoomParams
CreateRoomParams
Parameters for room creation
true
CreateRoomParams:
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:
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:
string
Room ID
true
Join a room
Join an existing room.
Input parameter:
roomId
string
Room ID
true
reason
string
Reason for joining
false
viaServers
string array
array of node domains
false
Output parameter:
string
Room ID
true
Leave a room
Leave an existing room.
Input parameter:
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:
address
String
Target user's wallet address
true
Output parameter:
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:
roomId
String
ID of the room
True
reason
String
Reason for deletion
False
Output parameter: None
Hide Room
Hides a room from the room list. The room will automatically reappear when a new message is received.
Input Parameter:
roomId
string
Room ID
true
Output Parameter: None
Show Room
Makes a previously hidden room visible again.
Input Parameter:
roomId
string
Room ID
true
Output Parameter: None
Get Private Chat Room
Gets the existing private chat room with a specified user.
Input Parameter:
otherUserId
string
Private chat user ID
true
Output Parameter:
string
Private chat room ID
false
RoomPushRuleService API
Get RoomPushRuleService object via Room object
Set Room Notification State
Modify the notification settings for a room.
Input parameter:
roomNotificationState
RoomNotificationState
Notification state
true
RoomNotificationState values:
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:
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:
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:
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:
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:
Cancelable
A cancelable object
true
Send media file
Send a media file to a room.
Input parameter:
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:
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:
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:
Cancelable
A cancelable object
true
Send live location message
Share a live location update in a room.
Input parameter:
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:
Cancelable
A cancelable object
true
Last updated