Retrieve Current Document Text note.document.content.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:
noteWho can execute the method: a user with access to the Knowledge base module and "View" permission for the document's knowledge base
This method belongs to REST 3.0. The call specifics and response format of the new API version are described in the REST 3.0 overview.
The note.document.content.get method retrieves the current document text in Markdown and the blocks that Markdown cannot fully represent.
Unlike note.document.get, this method reads the current state of the collaborative editor without lag. The old values passed to note.document.content.edit are compared against this exact text.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
id* |
Document identifier. The identifier can be obtained using the note.document.tree.list method |
Code Examples
How to Use Examples in Documentation
The new API call differs by adding the /api/ segment to the request URL:
https://{installation_address}/rest/api/{user_id}/{webhook_token}/note.document.content.get
curl -X POST \
-H "Content-Type: application/json" \
-d '{"id":42}' \
https://**put_your_bitrix24_address**/rest/api/**put_your_user_id_here**/**put_your_webhook_here**/note.document.content.get
curl -X POST \
-H "Content-Type: application/json" \
-d '{"id":42,"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/api/note.document.content.get
import { Text } from '@bitrix24/b24jssdk'
import type { B24Frame } from '@bitrix24/b24jssdk'
declare const $b24: B24Frame
try {
const response = await $b24.actions.v3.call.make({
method: 'note.document.content.get',
params: { id: 42 },
requestId: Text.getUuidRfc4122()
})
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
} else {
console.info(response.getData()!.result)
}
} catch (error) {
console.error(error)
}
<script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
<script>
async function getContent() {
try {
const $b24 = await B24Js.initializeB24Frame()
const response = await $b24.actions.v3.call.make({
method: 'note.document.content.get',
params: { id: 42 },
requestId: B24Js.Text.getUuidRfc4122()
})
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
return
}
console.info(response.getData().result)
} catch (error) {
console.error(error)
}
}
document.addEventListener('DOMContentLoaded', getContent)
</script>
There is no ready-made wrapper for this method in b24pysdk yet, and it is not included in the SDK's REST 3.0 method list. Add the method to Config().api_v3_methods and call it via bitrix_token.call_method with prefer_version=3.
from b24pysdk import Config
from b24pysdk.errors import BitrixSDKException
from b24pysdk.errors.v3 import BitrixAPIError
method = "note.document.content.get"
Config().configure(api_v3_methods=Config().api_v3_methods | {method})
try:
response = bitrix_token.call_method(
api_method=method,
params={
"id": 42,
},
prefer_version=3,
)
item = response["result"]["item"]
print(item["markdown"], item["lossless"])
except BitrixAPIError as error:
print(f"code: {error.code}", f"message: {error.error.message}", sep="\n")
except BitrixSDKException as error:
print(f"Bitrix SDK error: {error.message}")
The SDK does not yet support calls to the /rest/api/ address. Use direct HTTP requests, for example, via curl or fetch.
The JS API does not yet support calls to the /rest/api/ address. Use direct HTTP requests, for example, via fetch.
CRest does not yet support calls to the /rest/api/ address. Use direct HTTP requests, for example, via curl.
The SDK does not yet support calls to the /rest/api/ address. Use a direct HTTP request.
Response Handling
HTTP status: 200
{
"result": {
"item": {
"id": 42,
"markdown": "# Chapter 1\n\nDocument text",
"lossless": true,
"opaqueBlocks": []
}
},
"time": {
"start": 1795591363,
"finish": 1795591363.867149,
"duration": 0.8671491146087644,
"processing": 0,
"date_start": "2026-11-25T10:22:43+03:00",
"date_finish": "2026-11-25T10:22:43+03:00",
"operating_reset_at": 1795591920,
"operating": 0
}
}
Returned Data
|
Name |
Description |
|
item |
Current document content. Object structure description |
|
time |
Information about the request execution time |
Item Object
|
Name |
Description |
|
id |
Document identifier |
|
markdown |
Current document text in Markdown |
|
lossless |
|
|
opaqueBlocks |
Array of blocks that Markdown cannot fully represent. Object structure description |
OpaqueBlocks Object
Each array element contains the following fields.
|
Name |
Description |
|
index |
Block position among the document's top-level blocks, starting from |
|
nodeType |
Editor block type |
|
excerpt |
First 200 characters of the block's Markdown representation with whitespace collapsed |
|
reasons |
Reasons why the block cannot be represented in Markdown without loss. For example: Additional details may be specified after a colon |
Error Handling
HTTP status: 409
{
"error": {
"code": "NOTE_CONTENT_FORMAT_UNSUPPORTED",
"message": "The article content is stored in a legacy format that this method does not support. Use note.document.get to get the text."
}
}
|
Name |
Description |
|
error.code |
String error code. Use it to identify the type of exception |
|
error.message |
Text description of the error |
|
error.validation |
Array with error details. Present only in data validation errors |
|
error.validation[].field |
Name of the field where the validation error occurred |
|
error.validation[].message |
Description of the error related to the specified field |
Possible Error Codes
|
HTTP Status |
Code |
Description |
|
|
|
The document content is stored in a legacy format that the method does not support. Retrieve the text using note.document.get |
|
|
|
The current document content on the server is too large for the method to process. Open the document in the editor and repeat the call |
|
|
|
Parsing the document content exceeds the allowed processing budget |
|
|
|
The current state of the document could not be read |
|
|
|
The document does not exist, the user cannot view it, or a template or a knowledge base system document was specified |
The method retrieves the text of both archived documents and documents in the Recycle Bin if the user can view them.
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 SQL query inside the method ran longer than the SQL query time limit. The |
|
|
|
The method is blocked because the request resource intensity limit has been exceeded. The block lasts 5 minutes, after which the accumulated execution time of the method is counted from zero |
|
|
|
The same block in REST 3.0 methods. The |
|
|
|
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 — |
|
|
|
The Bitrix24 Market application is blocked because the number of installed applications exceeds the plan limit. Events are not delivered to such an application. Applications exempt from the limit are not blocked |
|
|
|
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 |