لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/entities/pages/catalog-content.md فهرس التوثيق — /llms.txt

مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.

Read a catalog sample

GET /v1/block-repository/:code/content

Returns the HTML sample of a block from the block catalog. The sample shows the markup and node classes before the block is added to a page.

Parameters

Parameter Type Required Description
Parametercode (path) Typestring Requiredyes DescriptionCatalog block code without the bitrix: prefix, for example 27.3.one_col_fix_title. A code with the prefix returns 404. To get the list, call GET /v1/block-repository: the code is the key of an element in a section's items. It comes without the prefix and can be passed as is. Application block codes repo_N and "My blocks" template codes of the form sourceCode@blockId are also accepted. Encode the @ character with encodeURIComponent
Parameterscope (query) Typestring Requiredno DescriptionInternal landing area: KNOWLEDGE — knowledge base, GROUP — group knowledge base, MAINPAGE — home page. Omit it for a regular site

Examples

curl — personal key

Terminal
curl "https://vibecode.bitrix24.com/v1/block-repository/27.3.one_col_fix_title/content" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl "https://vibecode.bitrix24.com/v1/block-repository/27.3.one_col_fix_title/content" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"

JavaScript — personal key

javascript
const code = encodeURIComponent("27.3.one_col_fix_title")
const response = await fetch(`https://vibecode.bitrix24.com/v1/block-repository/${code}/content`, {
  headers: {"X-Api-Key": "YOUR_API_KEY"},
})
const result = await response.json()
if (!response.ok) throw new Error(result.error.message)
console.log(result.data)

JavaScript — OAuth application

javascript
const code = encodeURIComponent("27.3.one_col_fix_title")
const response = await fetch(`https://vibecode.bitrix24.com/v1/block-repository/${code}/content`, {
  headers: {"X-Api-Key": "YOUR_APP_KEY", "Authorization": "Bearer USER_SESSION_TOKEN"},
})
const result = await response.json()
if (!response.ok) throw new Error(result.error.message)
console.log(result.data)

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata.code Typestring DescriptionBlock code in the form it was passed in the path
Fielddata.html Typestring DescriptionHTML sample of the block. If the markup contains an address with credentials, the whole string is replaced with [REDACTED]

Response example

JSON
{
  "success": true,
  "data": {
    "code": "27.3.one_col_fix_title",
    "html": "<section class=\"landing-block js-animation g-pt-30 g-pb-30\">\n\t<h2 class=\"landing-block-node-title js-animation fadeIn g-my-0 container g-max-width-container g-pl-15 g-pr-15 g-color\">The title</h2>\n</section>"
  }
}

Error response example

404 — there is no sample with this code, or the code was passed with the bitrix: prefix:

JSON
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Block sample not found."
  }
}

Errors

HTTP Code Description
HTTP404 CodeENTITY_NOT_FOUND DescriptionBlock sample not found. — there is no sample with this code, or the code was passed with the bitrix: prefix
HTTP404 CodeENTITY_NOT_FOUND DescriptionBlock or page not found. — the catalog of the current Bitrix24 account has no block with this code. Which of the two messages arrives depends on the step at which the block was not found
HTTP400 CodeINVALID_PARAMS Descriptioncode must be a non-empty block code. — code is empty or contains only spaces
HTTP400 CodeINVALID_SCOPE Descriptionscope is not KNOWLEDGE, GROUP or MAINPAGE
HTTP502 CodeBITRIX_INVALID_RESPONSE DescriptionBitrix24 returned an invalid block sample. — Bitrix24 returned a sample that is not a string
HTTP502 CodeBITRIX_INVALID_RESPONSE DescriptionBitrix24 block response exceeds the 8 MiB limit. — the Bitrix24 response is larger than 8 MiB
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 rejected the request. The error text comes from Bitrix24
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the landing scope
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionThe Bitrix24 user on whose behalf the key was issued has no permission to read the catalog
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header is missing
HTTP401 CodeINVALID_API_KEY DescriptionThe key in X-Api-Key was not found or has been revoked
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured tokens
HTTP409 CodeLANDING_MODULE_NOT_ENABLED DescriptionThe Sites module is unavailable on the Bitrix24 account
HTTP409 CodePORTAL_ADDRESS_CHANGED DescriptionThe on-premise Bitrix24 moved to a new address, but the key's webhook was issued for the old one. Reissue the key's webhook
HTTP429 CodeRATE_LIMITED DescriptionThe Bitrix24 request limit was exceeded. Retry the request in 1-2 seconds
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionBitrix24 did not respond or responded with a server error
HTTP503 CodeBITRIX_TIMEOUT DescriptionBitrix24 did not respond within the allotted time

Full list of common API errors — Errors.

Known specifics

  • Application blocks are read from the current Bitrix24 account. The repo_N code refers to blocks that applications added to the catalog of the current Bitrix24 account.
  • A read-only key works. The method only reads data, so a key in read-only mode gets a response.

See also