لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/entities/pages/preview.md فهرس التوثيق — /llms.txt
مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.
Page preview
GET /v1/pages/:id/preview
Returns the absolute URL of a site page's preview image. The method does not download the image file itself.
Requires the landing scope. A read-only key works.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionPage ID. List: GET /v1/pages |
Parameterscope (query) |
Typestring | Requiredno | DescriptionSite type: KNOWLEDGE — knowledge base, GROUP — workgroup site, MAINPAGE — main page. Omit the parameter for pages of all other sites |
Examples
curl — personal key
curl -X GET "https://vibecode.bitrix24.com/v1/pages/3/preview" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl -X GET "https://vibecode.bitrix24.com/v1/pages/3/preview" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN"
JavaScript — personal key
const response = await fetch("https://vibecode.bitrix24.com/v1/pages/3/preview", {
method: "GET",
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
const response = await fetch("https://vibecode.bitrix24.com/v1/pages/3/preview", {
method: "GET",
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 |
Typeobject | DescriptionPage preview |
Fielddata.previewUrl |
Typestring | DescriptionAbsolute URL of the preview image |
Response example
The page preview has been generated, and the URL serves the page image:
{
"success": true,
"data": {
"previewUrl": "https://example.bitrix24.site/preview.jpg"
}
}
Error response example
404 — no page with this id:
{
"success": false,
"error": {
"code": "ENTITY_NOT_FOUND",
"message": "Page not found."
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionPage not found. — no page with this id |
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionPage or folder not found. — Bitrix24 did not find the page when the preview was requested |
| HTTP400 | CodeINVALID_PAGE_ID |
Descriptionid must be a positive safe integer. — id is not a positive integer |
| HTTP400 | CodeINVALID_SCOPE |
Descriptionscope must be KNOWLEDGE, GROUP or MAINPAGE, or omitted. — scope is not KNOWLEDGE, GROUP or MAINPAGE |
| HTTP422 | CodeBITRIX_NO_EFFECT |
DescriptionBitrix24 did not return a page URL. — Bitrix24 did not return a preview URL |
| HTTP422 | CodeBITRIX_NO_EFFECT |
DescriptionBitrix24 returned an invalid page URL. — Bitrix24 returned a URL that is not an http or https URL, or a URL containing a username and password |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 rejected the request. The error message comes from Bitrix24 |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe API key does not have the landing scope |
| HTTP403 | CodeBITRIX_ACCESS_DENIED |
DescriptionThe Bitrix24 user the key was issued for has no permission to read the page |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe API key has no configured tokens |
| 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 |
| 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
- Until the preview is generated, a placeholder is returned. In that case the
previewUrladdress serves a placeholder image instead of the page image.