Get Post Comments log.blogcomment.get
Choose a tool for developing with an AI agent:
- use Alaio Vibecode to build an app for Bitrix24 from a task description without knowing any programming language. The agent writes the code and deploys the app to a server, with no manual hosting setup
- use the MCP server to develop a REST API integration in your own project. The agent refers to the official REST documentation
Scope:
logWho can execute the method: a user with read access to the post
The method log.blogcomment.get returns published comments on a News Feed post and information about the files attached to them.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
POST_ID* |
News Feed post identifier. The post identifier can be obtained using the log.blogpost.get method |
|
FIRST_ID |
The method returns comments with identifiers greater than the specified value. Comments are sorted by identifier in ascending order. If you pass Cannot be passed together with |
|
LAST_ID |
The method returns comments with identifiers less than the specified value. Comments are sorted by identifier in descending order. Cannot be passed together with |
|
LIMIT |
The number of comments in the response. The maximum value is |
If you pass neither FIRST_ID nor LAST_ID, the method returns the latest comments in descending order of identifier. To get the next batch, pass the smallest id from the previous response in LAST_ID.
Code Examples
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"POST_ID":319,"LAST_ID":62,"LIMIT":3}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/log.blogcomment.get
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"POST_ID":319,"LAST_ID":62,"LIMIT":3,"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/log.blogcomment.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 BlogCommentGetResult = {
COMMENTS: {
id: number
comment_id: number
post_id: number
parent_id: number
author_id: number
date: ISODate
text: string
attach: number[]
}[]
// An empty array is returned when no files are attached
FILES: [] | Record<string, {
id: number
date: ISODate
type: 'file' | 'image' | 'video'
name: string
size: number
image: { width: number, height: number } | false
authorId: number
authorName: string
urlPreview: string | null
urlShow: string
urlDownload: string
}>
}
try {
const response = await $b24.actions.v2.call.make<BlogCommentGetResult>({
method: 'log.blogcomment.get',
params: {
POST_ID: 319,
LAST_ID: 62,
LIMIT: 3,
},
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 getBlogComments() {
try {
// Initialize the SDK inside a Bitrix24 frame
const $b24 = await B24Js.initializeB24Frame()
const response = await $b24.actions.v2.call.make({
method: 'log.blogcomment.get',
params: {
POST_ID: 319,
LAST_ID: 62,
LIMIT: 3,
},
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', getBlogComments)
</script>
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
try:
bitrix_response = client.log.blogcomment.get(
post_id=319,
last_id=62,
limit=3,
).response
result = bitrix_response.result
print(result)
except BitrixAPIError as error:
print(
"Bitrix API error",
f"error: {error.error}",
f"error_description: {error.error_description}",
sep="\n",
)
except BitrixSDKException as error:
print(f"Bitrix SDK error: {error.message}")
except Exception as error:
print(f"Unexpected error: {error}")
try {
$response = $b24Service
->core
->call(
'log.blogcomment.get',
[
'POST_ID' => 319,
'LAST_ID' => 62,
'LIMIT' => 3,
]
);
$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.get', {
POST_ID: 319,
LAST_ID: 62,
LIMIT: 3
},
function(result) {
if (result.error()) {
console.error(result.error());
} else {
console.info(result.data());
}
}
);
require_once('crest.php');
$result = CRest::call(
'log.blogcomment.get',
[
'POST_ID' => 319,
'LAST_ID' => 62,
'LIMIT' => 3,
]
);
if (!empty($result['error'])) {
echo 'Error: ' . $result['error_description'];
} else {
echo 'Comments: ' . print_r($result['result'], true);
}
// client and ctx are already created — see the Go SDK section
res, err := client.Core().Call(ctx, "log.blogcomment.get", b24.Params{
"POST_ID": 319,
"LAST_ID": 62,
"LIMIT": 3,
}, b24.WithIdempotent())
if err != nil {
return fmt.Errorf("log.blogcomment.get: %w", err)
}
// The response shape is shown below on this page.
fmt.Printf("%s\n", res.Result)
Response Handling
HTTP Status: 200
{
"result": {
"COMMENTS": [
{
"id": 61,
"comment_id": 61,
"post_id": 319,
"parent_id": 0,
"author_id": 28,
"date": "2026-10-21T16:38:05+02:00",
"text": "The process diagram is attached",
"attach": [
10885
]
},
{
"id": 59,
"comment_id": 59,
"post_id": 319,
"parent_id": 0,
"author_id": 28,
"date": "2026-10-21T16:37:30+02:00",
"text": "I support the idea",
"attach": [
10883
]
},
{
"id": 57,
"comment_id": 57,
"post_id": 319,
"parent_id": 0,
"author_id": 28,
"date": "2026-10-21T16:37:27+02:00",
"text": "First comment",
"attach": []
}
],
"FILES": {
"10883": {
"id": 10883,
"date": "2026-10-21T16:37:55+02:00",
"type": "file",
"name": "notes.txt",
"size": 37,
"image": false,
"authorId": 28,
"authorName": "Klaus Weber",
"urlPreview": null,
"urlShow": "https://test.bitrix24.com/disk/downloadFile/10883/?&ncc=1&filename=notes.txt",
"urlDownload": "https://test.bitrix24.com/disk/downloadFile/10883/?&ncc=1&filename=notes.txt"
},
"10885": {
"id": 10885,
"date": "2026-10-21T16:38:20+02:00",
"type": "image",
"name": "diagram.png",
"size": 70,
"image": {
"width": 1,
"height": 1
},
"authorId": 28,
"authorName": "Klaus Weber",
"urlPreview": "https://test.bitrix24.com/disk/showFile/10885/?&ncc=1&width=640&height=640&signature=**signature**&ts=1792589900&filename=diagram.png",
"urlShow": "https://test.bitrix24.com/disk/showFile/10885/?&ncc=1&ts=1792589900&filename=diagram.png",
"urlDownload": "https://test.bitrix24.com/disk/downloadFile/10885/?&ncc=1&filename=diagram.png"
}
}
},
"time": {
"start": 1792589984,
"finish": 1792589984.324943,
"duration": 0.32494306564331055,
"processing": 0,
"date_start": "2026-10-21T16:39:44+02:00",
"date_finish": "2026-10-21T16:39:44+02:00",
"operating_reset_at": 1792590540,
"operating": 0
}
}
Returned Data
|
Name |
Description |
|
result |
The root object of the response (detailed description) |
|
time |
Information about the execution time of the request |
Object result
|
Name |
Description |
|
COMMENTS |
Array of comments (detailed description). If there are no comments or the |
|
FILES |
Files attached to the comments. The key is the Drive file identifier, and the value is the file description (detailed description). If there are no files, an empty array |
COMMENTS Array Element
|
Name |
Description |
|
id |
Comment identifier |
|
comment_id |
Comment identifier, matches |
|
post_id |
News Feed post identifier |
|
parent_id |
Parent comment identifier |
|
author_id |
Comment author identifier |
|
date |
Comment creation date and time in ISO 8601 format |
|
text |
Comment text. For system comments, the text displayed in the Feed is returned |
|
attach |
Identifiers of the Drive files attached to the comment. The description of each file is in the |
File Object in FILES
|
Name |
Description |
|
id |
Drive file identifier |
|
date |
File creation date and time in ISO 8601 format |
|
type |
File type: |
|
name |
File name |
|
size |
File size in bytes |
|
Image or video dimensions in pixels: |
|
|
authorId |
Identifier of the user who uploaded the file |
|
authorName |
Name of the user who uploaded the file |
|
urlPreview |
Link to a preview up to 640×640 pixels. For a file without a preview that is not an image, |
|
urlShow |
Link to view the image. For other files, a download link |
|
urlDownload |
Link to download the file |
Error Handling
HTTP Status: 400
{
"error": "ERROR_ARGUMENT",
"error_description": "POST_ID must be a positive integer"
}
|
Name |
Description |
|
error |
String error code. It consists of digits, Latin letters, and underscores. It may arrive empty — in that case only |
|
error_description |
Error message for the developer. Do not show it to the end user without processing |
Possible Error Codes
|
Status |
Code |
Description |
Value |
|
|
|
POST_ID must be a positive integer |
|
|
|
|
FIRST_ID and LAST_ID cannot be used together |
|
|
|
|
Post not found |
The post with the passed |
Statuses and System Error Codes
HTTP Status: 4xx, 5xx
The errors described below are returned by the REST API itself, not by the logic of a specific method. They can arrive in response to any method.
|
Status |
Code |
Description |
|
|
|
An internal server error has occurred. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support |
|
|
|
The server returned an unexpected response. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support |
|
|
|
The request intensity limit has been exceeded |
|
|
|
The method is blocked because the request resource intensity limit has been exceeded. The block is lifted automatically once the accumulated execution time of the method no longer exceeds the limit |
|
|
|
The request contains no authorization data: neither an access token nor a webhook code was passed |
|
|
|
Methods are called over the HTTPS protocol only |
|
|
|
The REST API is blocked due to overload. This is a manual individual block. To have it lifted, contact Bitrix24 technical support |
|
|
|
REST API access is not active for this account. In Bitrix24 Cloud, check the current plan or trial status: Vibe+ plans include REST API access, while Essentials plans do not. A webhook receives a different error message — |
|
|
|
No active webhook with the specified user identifier and secret code was found |
|
|
|
No method with this name was found. The name is misspelled, the method does not exist in the REST API, or it is unavailable without the required scope |
|
|
|
The request requires broader permissions than the token has: for a webhook these are the permissions granted to it, for an application it is the scope. For an application, the error message ends with |
|
|
|
The access token has expired |
|
|
|
The application is installed, but the Bitrix24 administrator has granted access to it only to specific users |
|
|
|
The public part of the site is closed. To open it on an on-premise installation, disable the "Temporary closure of the public part of the site" option. Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site |