Views: 2545
Last Modified: 23.03.2022

Deletes chatbot message

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
MESSAGE_ID 1 Yes Message ID 18

Called method and response

PHP

$result = restCommand('im.message.delete', Array(

    'MESSAGE_ID' => 1,

), $_REQUEST["auth"]);

Response example

{
	"result": true
}
Result: true or error.


Example of response on error

{
    "error": "MESSAGE_ID_ERROR",
    "error_description": "Message ID not passed"
}

Key description:

  • error – error code
  • error_description – error brief description

Possible error codes

Code Description
MESSAGE_ID_ERROR Message ID not passed
CANT_EDIT_MESSAGE You don't have access to this message



Courses developed by Bitrix24