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: log

Who 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
type

Description

POST_ID*
integer

News Feed post identifier.

The post identifier can be obtained using the log.blogpost.get method

FIRST_ID
integer

The method returns comments with identifiers greater than the specified value. Comments are sorted by identifier in ascending order.

If you pass 0, the method returns comments from the beginning of the list in ascending order of identifier.

Cannot be passed together with LAST_ID

LAST_ID
integer

The method returns comments with identifiers less than the specified value. Comments are sorted by identifier in descending order.

Cannot be passed together with FIRST_ID

LIMIT
integer

The number of comments in the response. The maximum value is 1000; a larger value is replaced with 1000. If the value is not passed or is less than 1, the method returns 100 comments

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
type

Description

result
object

The root object of the response (detailed description)

time
time

Information about the execution time of the request

Object result

Name
type

Description

COMMENTS
object[]

Array of comments (detailed description). If there are no comments or the blog module is not installed, an empty array is returned

FILES
object

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 [] is returned

COMMENTS Array Element

Name
type

Description

id
integer

Comment identifier

comment_id
integer

Comment identifier, matches id

post_id
integer

News Feed post identifier

parent_id
integer

Parent comment identifier

author_id
integer

Comment author identifier

date
datetime

Comment creation date and time in ISO 8601 format

text
string

Comment text. For system comments, the text displayed in the Feed is returned

attach
integer[]

Identifiers of the Drive files attached to the comment. The description of each file is in the FILES object under this identifier

File Object in FILES

Name
type

Description

id
integer

Drive file identifier

date
datetime

File creation date and time in ISO 8601 format

type
string

File type: image, video, or file

name
string

File name

size
integer

File size in bytes

image
object | boolean

Image or video dimensions in pixels: width and height. For other files, false is returned

authorId
integer

Identifier of the user who uploaded the file

authorName
string

Name of the user who uploaded the file

urlPreview
string

Link to a preview up to 640×640 pixels. For a file without a preview that is not an image, null is returned

urlShow
string

Link to view the image. For other files, a download link

urlDownload
string

Link to download the file

Error Handling

HTTP Status: 400

{
            "error": "ERROR_ARGUMENT",
            "error_description": "POST_ID must be a positive integer"
        }
        

Name
type

Description

error
string

String error code. It consists of digits, Latin letters, and underscores. It may arrive empty — in that case only error_description shows the reason

error_description
string

Error message for the developer. Do not show it to the end user without processing

Possible Error Codes

Status

Code

Description

Value

400

ERROR_ARGUMENT

POST_ID must be a positive integer

POST_ID is not passed, or a value less than 1 is passed

400

ERROR_ARGUMENT

FIRST_ID and LAST_ID cannot be used together

FIRST_ID and LAST_ID are passed at the same time

404

ERROR_NOT_FOUND

Post not found

The post with the passed POST_ID was not found, or the user does not have read access to it

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
Error Message

Description

500

INTERNAL_SERVER_ERROR
Internal server error

An internal server error has occurred. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support

500

ERROR_UNEXPECTED_ANSWER
Server returned an unexpected response

The server returned an unexpected response. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support

503

QUERY_LIMIT_EXCEEDED
Too many requests

The request intensity limit has been exceeded

429

OPERATION_TIME_LIMIT
Method is blocked due to operation time limit

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

401

NO_AUTH_FOUND
Wrong authorization data

The request contains no authorization data: neither an access token nor a webhook code was passed

401

INVALID_REQUEST
Https required

Methods are called over the HTTPS protocol only

401

OVERLOAD_LIMIT
REST API is blocked due to overload

The REST API is blocked due to overload. This is a manual individual block. To have it lifted, contact Bitrix24 technical support

401

ACCESS_DENIED
REST is available only on commercial plans

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 — REST is available only by subscription

401

INVALID_CREDENTIALS
Invalid request credentials

No active webhook with the specified user identifier and secret code was found

404

ERROR_METHOD_NOT_FOUND
Method not 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

401

insufficient_scope
The request requires higher privileges than provided by the webhook token

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 provided by the access token

401

expired_token
The access token provided has expired

The access token has expired

401

user_access_error
The user does not have access to the application

The application is installed, but the Bitrix24 administrator has granted access to it only to specific users

403

PORTAL_DELETED
Portal was deleted

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

Continue Learning