метод REST
scope: imbot
Устаревший
imbot.bot.list
Получить список чат-ботов
Устаревший метод.
Развитие метода остановлено. Используйте imbot.v2.Bot.list.
Описание
Метод imbot.bot.list возвращает список зарегистрированных чат-ботов.
Без параметров.
Примеры запроса
curl -X POST /
-H "Content-Type: application/json" /
-H "Accept: application/json" /
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/imbot.bot.list
curl -X POST /
-H "Content-Type: application/json" /
-H "Accept: application/json" /
-d '{"auth":"**put_access_token_here**"}' /
https://**put_your_bitrix24_address**/rest/imbot.bot.list
try {
const response = await $b24.callMethod('imbot.bot.list', {});
const { result } = response.getData();
console.log('Bots:', result);
} catch (error) {
console.error('Error getting bot list:', error);
}
try {
$response = $b24Service
->core
->call('imbot.bot.list', []);
$result = $response
->getResponseData()
->getResult();
if ($result->error()) {
echo 'Error: ' . $result->error();
} else {
print_r($result->data());
}
} catch (Throwable $exception) {
error_log($exception->getMessage());
echo 'Error getting bot list: ' . $exception->getMessage();
}
BX24.callMethod(
'imbot.bot.list',
{},
function(result) {
if (result.error()) {
console.error(result.error().ex);
} else {
console.log(result.data());
}
}
);
require_once('crest.php');
$result = CRest::call('imbot.bot.list', []);
if (!empty($result['error'])) {
echo 'Error: ' . $result['error_description'];
} else {
print_r($result['result']);
}
// client и ctx уже созданы — см. раздел «SDK для Go»
res, err := client.Core().Call(ctx, "imbot.bot.list", nil, b24.WithIdempotent())
if err != nil {
return fmt.Errorf("imbot.bot.list: %w", err)
}
// Ответ — объект, где ключ верхнего уровня — идентификатор.
var items map[string]struct {
ID b24.ID `json:"ID"`
Name string `json:"NAME"`
Code string `json:"CODE"`
Openline string `json:"OPENLINE"`
}
if err := json.Unmarshal(res.Result, &items); err != nil {
return fmt.Errorf("разбор ответа: %w", err)
}
for id, it := range items {
fmt.Println(id, it.Name)
}
Ответ
{
"result": {
"39": {
"ID": 39,
"NAME": "NewBot",
"CODE": "newbot",
"OPENLINE": "N"
}
},
"time": {
"start": 1728626400.123,
"finish": 1728626400.234,
"duration": 0.111,
"processing": 0.045,
"date_start": "2024-10-11T10:00:00+03:00",
"date_finish": "2024-10-11T10:00:00+03:00",
"operating_reset_at": 1762349466,
"operating": 0
}
}
Обработка ошибок
HTTP-статус: 403
{
"error": "WRONG_AUTH_TYPE",
"error_description": "Access for this method not allowed by session authorization."
}
| Код | Описание | Значение |
|---|---|---|
WRONG_AUTH_TYPE |
Access for this method not allowed by session authorization. | Метод вызван с сессионной авторизацией вместо OAuth или вебхука |

