log.blogcomment.user.get
Получить комментарии пользователя
Описание
Метод log.blogcomment.user.get возвращает список комментариев к сообщению Ленты новостей для указанного пользователя и информацию о прикрепленных файлах.
Параметры
USER_ID
integer
необязательный
Идентификатор пользователя, чьи комментарии нужно получить. Если идентификатор не указан, метод вернет комментарии текущего пользователя.
Если запрос выполняется администратором за другого пользователя, в ответе поле text может быть пустым.
Идентификатор пользователя можно получить с помощью метода user.get или user.search
FIRST_ID
integer
необязательный
Метод вернет комментарии с идентификаторами, которые больше указанного значения
LAST_ID
integer
необязательный
Метод вернет комментарии с идентификаторами, которые меньше указанного значения
LIMIT
integer
необязательный
Количество записей в ответе. Допустимое значение — от 1 до 100. По умолчанию возвращается 100 комментариев
Примеры запроса
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"USER_ID":28,"FIRST_ID":215,"LAST_ID":216}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/log.blogcomment.user.get
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"USER_ID":28,"FIRST_ID":215,"LAST_ID":216,"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/log.blogcomment.user.get
// This snippet is an ES module: top-level await requires type="module" or a bundler.
// $b24 is an already-initialized SDK instance (see the SDK "Get started" guide).
import { Text } from '@bitrix24/b24jssdk'
import type { B24Frame, ISODate } from '@bitrix24/b24jssdk'
declare const $b24: B24Frame
// Shape of the payload returned in result (match the "response handling" section of the page)
type BlogCommentUserGetResult = {
comments: {
id: number
comment_id: number
log_id: number
date: ISODate
text: string
attach: number[]
}[]
files: Record<string, {
id: number
date: ISODate
type: string
name: string
size: number
image?: {
width: number
height: number
}
authorId: number
authorName: string
urlPreview: string
urlShow: string
urlDownload: string
}>
}
try {
const response = await $b24.actions.v2.call.make<BlogCommentUserGetResult>({
method: 'log.blogcomment.user.get',
params: {
USER_ID: 28,
FIRST_ID: 215,
LAST_ID: 216,
},
requestId: Text.getUuidRfc4122()
})
// The payload is available only on a successful response
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
} else {
const result = response.getData()!.result
console.info('Comments:', result.comments, 'Files:', result.files)
}
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
<!-- Load the SDK (UMD build); it is exposed as the global B24Js -->
<script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
<script>
async function getBlogCommentsForUser() {
try {
// Initialize the SDK inside a Bitrix24 frame
const $b24 = await B24Js.initializeB24Frame()
const response = await $b24.actions.v2.call.make({
method: 'log.blogcomment.user.get',
params: {
USER_ID: 28,
FIRST_ID: 215,
LAST_ID: 216,
},
requestId: B24Js.Text.getUuidRfc4122()
})
// The payload is available only on a successful response
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
return
}
const result = response.getData().result
console.info('Comments:', result.comments, 'Files:', result.files)
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
}
document.addEventListener('DOMContentLoaded', getBlogCommentsForUser)
</script>
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
try:
bitrix_response = client.log.blogcomment.user.get(
user_id=28,
first_id=215,
last_id=216,
).response
result = bitrix_response.result
print(result)
except BitrixAPIError as error:
print(
"Ошибка Bitrix API",
f"error: {error.error}",
f"error_description: {error.error_description}",
sep="\n",
)
except BitrixSDKException as error:
print(f"Ошибка Bitrix SDK: {error.message}")
except Exception as error:
print(f"Непредвиденная ошибка: {error}")
try {
$response = $b24Service
->core
->call(
'log.blogcomment.user.get',
[
'USER_ID' => 28,
'FIRST_ID' => 215,
'LAST_ID' => 216,
]
);
$result = $response
->getResponseData()
->getResult();
if ($result->error()) {
echo 'Error: ' . $result->error();
} else {
echo 'Comments: ' . print_r($result->data(), true);
}
} catch (Throwable $exception) {
error_log($exception->getMessage());
echo 'Error getting blog comments: ' . $exception->getMessage();
}
BX24.callMethod('log.blogcomment.user.get', {
USER_ID: 28,
FIRST_ID: 215,
LAST_ID: 216
},
function(result) {
if (result.error()) {
console.error(result.error());
} else {
console.info(result.data());
}
}
);
require_once('crest.php');
$result = CRest::call(
'log.blogcomment.user.get',
[
'USER_ID' => 28,
'FIRST_ID' => 215,
'LAST_ID' => 216,
]
);
if (!empty($result['error'])) {
echo 'Error: ' . $result['error_description'];
} else {
echo 'Comments: ' . print_r($result['result'], true);
}
// client и ctx уже созданы — см. раздел «SDK для Go»
res, err := client.Core().Call(ctx, "log.blogcomment.user.get", b24.Params{
"USER_ID": 28,
"FIRST_ID": 215,
"LAST_ID": 216,
}, b24.WithIdempotent())
if err != nil {
return fmt.Errorf("log.blogcomment.user.get: %w", err)
}
// Форма ответа показана ниже на этой странице.
fmt.Printf("%s\n", res.Result)
Ответ
HTTP-статус: 200
{
"result": {
"comments": [
{
"id": 4821,
"comment_id": 4821,
"log_id": 13579,
"date": "2025-01-28T11:05:42+03:00",
"text": "Поддерживаю идею!",
"attach": [
90210
]
}
],
"files": {
"90210": {
"id": 90210,
"date": "2025-01-28T11:02:18+03:00",
"type": "image",
"name": "diagram.png",
"size": 184320,
"image": {
"width": 1280,
"height": 720
},
"authorId": 28,
"authorName": "Иван Иванов",
"urlPreview": "https://example.bitrix24.ru/disk/showPreview/90210",
"urlShow": "https://example.bitrix24.ru/disk/showFile/90210",
"urlDownload": "https://example.bitrix24.ru/disk/downloadFile/90210"
}
}
},
"time": {
"start": 1728905100.112233,
"finish": 1728905100.498321,
"duration": 0.38608813285827637,
"processing": 0.14598798751831055,
"date_start": "2025-10-14T12:45:00+03:00",
"date_finish": "2025-10-14T12:45:00+03:00",
"operating": 0
}
}
Возвращаемые данные
result
object
Корневой объект ответа. Содержит массив комментариев и информацию о прикрепленных файлах
time
time
Информация о времени выполнения запроса

