Messaging

Product:

Send Message

Sends a message in the channel.

Request body

Name Description Mandatory
API URL http://api.cometondemand.net/api/sendmessage Yes
api-key The API Key present in your CometChat Admin Panel Yes
senderID The user ID of the sender. Yes
receiverID The user ID of the receiver. Yes
isGroup This parameter should be set to 1 if the message is sent to a group.
0: The receiving channel is a one-on-one chat
1: The receiving channel is a group
Yes
message The message body Yes
visibility Has three options only if isGroup = 0. Default’s to 0.
0: Visible to both sender and receiver
1: Visible only to the sender
2: Visible only to the receiver
No

Response

Success

{"success":{"status":"1000","message":"Message Send to One-One Successfully."}}
{"success":{"status":"1000","message":"Message Send to Group Successfully."}}

Send Message

Sends a message in the channel.

Request body

Name Description Mandatory
API URL http://api.cometondemand.net/api/sendmessage Yes
api-key The API Key present in your CometChat Admin Panel Yes
senderID The user ID of the sender. Yes
receiverID The user ID of the receiver. Yes
isGroup This parameter should be set to 1 if the message is sent to a group.
0: The receiving channel is a one-on-one chat
1: The receiving channel is a group
Yes
message The message body Yes
visibility Has three options only if isGroup = 0. Default’s to 0.
0: Visible to both sender and receiver
1: Visible only to the sender
2: Visible only to the receiver
No
isUID This parameter should be set to 1 if senderID and receiverID(isGroup = 0) are the site user id’s. Default’s to 0.
0: CometChat User ID
1: Site user ID (primary key of site’s users table)
No

Response

Success

{"success":{"status":"1000","message":"Message Send to One-One Successfully."}}
{"success":{"status":"1000","message":"Message Send to Group Successfully."}}
  • Was this helpful?
  • Yes   No