Views: 2824
Last Modified: 31.05.2023

Invites participants

Revision Get current information about current API revision (platform version) – im.revision.get : 18

Attention: restCommand function is used here for illustration purposes only. It is taken from the EchoBot example. You can send a REST command with your own function, or use the BX24.callMethod or bitrix24-php-sdk methods.

Parameters

Parameter Example Required Description Revision
CHAT_ID 13 Yes Chat ID 18
USERS Array(3,4) Yes New user IDs 18
HIDE_HISTORY N No Shows chat history for the user added using this method. Boolean Y/N - "N" by default. New user won't see the chat history, if passed as "Y". 18

Called method and response

PHP

$result = restCommand('im.chat.user.add', Array(

   'CHAT_ID' => 13,
   'USERS' => Array(3,4)
   'HIDE_HISTORY' => N,

), $_REQUEST["auth"]);

Response example

{
	"result": true
}

Example of response on error

{
    "error": "CHAT_ID_EMPTY",
    "error_description": "Chat ID not passed"
}

Key description:

  • error – error code
  • error_description – error brief code

Possible error codes

Code Description
CHAT_ID_EMPTY Chat ID not passed
WRONG_REQUEST You don't have sufficient access permissions for adding participants to chat or participant already included into chat



Courses developed by Bitrix24