Create a public/group/private dialog.
Use type=1
(PUBLIC_GROUP) to create a public dialog. All users from your application will be able to join it. The server will create a public chat and return a detailed information about the newly created dialog. Field xmpp_room_jid
will contain a Chat room JID to which you should connect to start chatting.
Use type=2
(GROUP) to create a group dialog only for specific users provided in occupants_ids
. The server will create a group chat (involving only members of this chat) and return a detailed information about the newly created dialog. Field xmpp_room_jids
will contain a Chat room JID to which you should connect to start chatting.
Use type=3
(PRIVATE) to create a private dialog between 2 users. The server will return a detailed information about the newly created dialog. If a user sends a chat message to some user and the private dialog wasn't created, it will be created automatically with the 1st chat message.
Custom parameters
Dialogs can store additional parameters. These parameters can be used to store additional data. Also, these parameters can be used in dialogs retrieval requests.
To start using additional parameters, create an additional schema of your parameters. This is a custom objects class. Just create an empty class with all fields that you need. These fields will be your dialog's additional parameters.
Next, to set additional parameters to a dialog, use next additional parameters in a creation request:
data[class_name]
- should contain Custom Objects class name created above.
data[...]
data[{field_name_N}]
- field N from Custom Object class.