Create Conversation
Description
Section titled “Description”wss conversation_create
The conversation_create
request creates a conversation object on the server and notifies all participants about it, if they have been added.
Request Parameters
Section titled “Request Parameters”Name | Type | Description |
---|---|---|
type | string | Conversation type |
name | string | Conversation name |
description | string | Description of conversation |
participants | array[string] | Array of participant IDs |
opponent_id | string | Opponent ID for private chat |
image_object.file_blur_hash | string | Blur hash for chat image |
image_object.file_name | string | Chat image name |
image_object.file_id | string | Chat image file id |
A type
param must have only one of three values:
u
- (user) - a private conversations for two people only.g
- (group) - conversations for a group of users, two or more.c
- (channel) - public channel conversation with admins and subscribers (admin access ‘rw’, subscribers access ‘r’).
Response Fields
Section titled “Response Fields”Name | Type | Description |
---|---|---|
conversation | object | Newly created Conversation object |
Example
Section titled “Example”{ "request": { "conversation_create": { "name": "ChantName", "description": "Description", "type": "g" "participants": [ "63077ad836b78c3d82af0812", "63077ad836b78c3d82af0866" ] }, "id": "RequestId" }}
{ "response": { "id": "RequestId", "conversation": { ... } } }
After conversation created, all the online participants will receive the following event about newly created conversation:
{ "system_message": { "_id": "646e2092d80fe5c4e688dfa0", "t": 15673838833, "cid": "646e2092d80fe5c4e688dfa0", "from": "63077ad836b78c3d82af0812", "x": { "conversation_created": { "_id": "646e2092d80fe5c4e688dfa0", "type": "u", "opponent_id": "646c823bf989c57fe910d289", "participants": ["646c823bf989c57fe910d289"], "owner_id": "646c82947b3aceab988c0073", "created_at": "2023-05-24T14:34:58.066Z", "updated_at": "2023-05-24T14:52:24.953Z" } } }}
See Also
Section titled “See Also” SAMA chat server API: Conversations When we developed our API, we followed three rules: fast, confidential, and scalable. Each of these rules has a powerful force when we choose which messenger you will use.
DataBase Records Collection of complete objects stored in the database.