Authorizations
API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).
Body
UID of the sender.
If the receiverType == “user” the UID of a user receiving the message. else GUID of the group.
The receiverType of the message. either user or group
user
, group
The unique identifier for the message
Category of the message. The available category is message
message
Defines the type of the message based on the selected category.
When category
is message
, the allowed values for type
are:
text
— Plain text message
image
— Image message
audio
— Audio message
video
— Video message
file
— File message
When category
is custom
, any custom string can be used as the type
. This allows developers to define and handle custom message types as needed in their UI implementation.
text
, image
, file
, audio
, video
Can contain any additional properties except for the key properties.
This property contains information about the sender user. It is required only if the sender does not already exist in CometChat. If provided, the sender user will be created before the message is processed.
This property contains information about the receiver user (in case of one-to-one messages). It is required only if the receiver user does not already exist in CometChat. If provided, the user will be created before the message is sent.
This property contains information about the group receiving the message. It is required only if the group does not already exist in CometChat. If provided, the group will be created before the message is sent.
String array containing developer defined tags.
10 digit unix timestamp at which the message would be sent. If left blank, the current timestamp would be used.
Response
Import Message(s)
The response is of type object
.