Group chat function

Basic command for adding a user to a dialog:


Where you can substitute the user id in hooks and then the correspondence with this user will open, the user id is the id of the user registered on your site. If you need to add a user to a chat group, then you can create and pup a button on the site, by clicking which the user will automatically join the conversation.

Group chat works like a room. There are three main commands for creating rooms and adding users to it:


imbaApi.openRoom (id)

Opens a room, with an ID number passed as an input parameter to a function


imbaApi.addToRoom ({users_ids: ['10'], room_id: '114'})

The room administrator (room creator) can add new users to it. Accepts an array with fields users_ids and room_id as input. If a non-admin adds, the user will not be added.


imbaApi.newRoom (['21', '10'], 'New Room 2', 0)

The user creates a new room, to which 2 or more users are added beside him, which are specified in the first input parameter, as in the example, Room name is the second parameter, the 3rd by default is 0.

Code for adding a group to the contact list

It can be added to any page on the site. When the page with this code is loaded, the group of the authorized user will be added to the list of his dialogs.

  window.imbaApi.on('ImbaChat.Auth.Success', () => {

    //unique name of group
    let pipe = "TG_341";

    //Title of group
    let title = "Title of group"

      pipe: pipe,
      title: title,
      is_public: 1,
      type: imbaApi.room_type.conference,

The example of group chat using:

There is new function of adding an authorized user to the chat room, which is described in the code. And also, if you hover over the avatar of a user who wrote a message in a group chat, his name will be displayed and a dialogue will open with him by clicking.

Another articles:

  • I also want to log in on this screen when the user logs in to my own CRM system, and I want to ensure that they correspond among themselves. If this is possible or I need to open a user through the portal for each of them. My goal is to let users communicate among themselves on the CRM system.
  • BobAustin 1 month ago
    All functions implemented. I will test it, it looks like an accessible explanation to the client, I give a thumbs up for the article and in principle for the development on wordpress group chat.