метод REST
scope: landing
landing.repo.checkContent
Проверить контент на опасные подстроки
Описание
Метод landing.repo.checkContent проверяет контент через санитайзер.
Параметры
content
string
необязательный
Контент для проверки
splitter
string
необязательный
Разделитель, которым помечаются опасные фрагменты в content.
По умолчанию: #SANITIZE#
Примеры запроса
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"content": "<div style=\"color:red\" onclick=\"alert(1)\"><iframe src=\"//evil.com\"></iframe></div>",
"splitter": "#AAA#"
}' \
"https://**put.your-domain-here**/rest/**user_id**/**webhook_code**/landing.repo.checkContent.json"
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"content": "<div style=\"color:red\" onclick=\"alert(1)\"><iframe src=\"//evil.com\"></iframe></div>",
"splitter": "#AAA#",
"auth": "**put_access_token_here**"
}' \
"https://**put.your-domain-here**/rest/landing.repo.checkContent.json"
// 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 } from '@bitrix24/b24jssdk'
declare const $b24: B24Frame
// Shape of the payload returned in result (match the "response handling" section of the page)
type CheckContentResult = {
is_bad: boolean
content: string
}
try {
const response = await $b24.actions.v2.call.make<CheckContentResult>({
method: 'landing.repo.checkContent',
params: {
content: '<div style="color:red" onclick="alert(1)"><iframe src="//evil.com"></iframe></div>',
splitter: '#AAA#',
},
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('Is bad content:', result.is_bad, '| Sanitized content:', result.content)
}
} 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 checkContent() {
try {
// Initialize the SDK inside a Bitrix24 frame
const $b24 = await B24Js.initializeB24Frame()
const response = await $b24.actions.v2.call.make({
method: 'landing.repo.checkContent',
params: {
content: '<div style="color:red" onclick="alert(1)"><iframe src="//evil.com"></iframe></div>',
splitter: '#AAA#',
},
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('Is bad content:', result.is_bad, '| Sanitized content:', result.content)
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
}
document.addEventListener('DOMContentLoaded', checkContent)
</script>
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
try:
bitrix_response = client.landing.repo.check_content(
content='<div style="color:red" onclick="alert(1)"><iframe src="//evil.com"></iframe></div>',
splitter="#AAA#",
).response
result = bitrix_response.result
print(result)
except BitrixAPIError as error:
print(
"Ошибка Bitrix API",
f"error: {error.error}",
f"error_description: {error.error_description}",
sep="\n",
)
except BitrixSDKException as error:
print(f"Ошибка Bitrix SDK: {error.message}")
except Exception as error:
print(f"Непредвиденная ошибка: {error}")
try {
$response = $b24Service
->core
->call(
'landing.repo.checkContent',
[
'content' => '<div style="color:red" onclick="alert(1)"><iframe src="//evil.com"></iframe></div>',
'splitter' => '#AAA#',
]
);
$result = $response
->getResponseData()
->getResult();
echo 'Success: ' . print_r($result, true);
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error checking content: ' . $e->getMessage();
}
BX24.callMethod(
'landing.repo.checkContent',
{
content: '<div style="color:red" onclick="alert(1)"><iframe src="//evil.com"></iframe></div>',
splitter: '#AAA#'
},
function(result)
{
if (result.error())
{
console.error(result.error());
}
else
{
console.info(result.data());
}
}
);
require_once('crest.php');
$result = CRest::call(
'landing.repo.checkContent',
[
'content' => '<div style="color:red" onclick="alert(1)"><iframe src="//evil.com"></iframe></div>',
'splitter' => '#AAA#',
]
);
if (isset($result['error']))
{
echo 'Ошибка: ' . $result['error_description'];
}
else
{
echo '<pre>';
print_r($result['result']);
echo '</pre>';
}
// client и ctx уже созданы — см. раздел «SDK для Go»
res, err := client.Core().Call(ctx, "landing.repo.checkContent", b24.Params{
"content": "<div style=\"color:red\" onclick=\"alert(1)\"><iframe src=\"//evil.com\"></iframe></div>",
"splitter": "#AAA#",
})
if err != nil {
return fmt.Errorf("landing.repo.checkContent: %w", err)
}
var item struct {
IsBad bool `json:"is_bad"`
Content string `json:"content"`
}
if err := json.Unmarshal(res.Result, &item); err != nil {
return fmt.Errorf("разбор ответа: %w", err)
}
fmt.Println(item.IsBad, item.Content)
Ответ
HTTP-статус: 200
{
"result": {
"is_bad": true,
"content": "\u003Cdiv style=\u0022color:red\u0022 oncl#AAA#ick=\u0022alert(1)\u0022\u003E\u003Cifr#AAA#ame src=\u0022\/\/evil.com\u0022\u003E\u003C\/iframe\u003E\u003C\/div\u003E"
},
"time": {
"start": 1774952664,
"finish": 1774952665.017161,
"duration": 1.0171608924865723,
"processing": 0,
"date_start": "2026-03-31T13:24:24+03:00",
"date_finish": "2026-03-31T13:24:25+03:00",
"operating_reset_at": 1774953265,
"operating": 0
}
}
Возвращаемые данные
result
object
Результат проверки подробнее
time
time
Информация о времени выполнения запроса
Обработка ошибок
HTTP-статус: 400
{
"error": "ERROR_ARGUMENT",
"error_description": "The value of an argument 'content' has an invalid type",
"argument": "content"
}
| Код | Описание | Значение |
|---|---|---|
MISSING_PARAMS |
Недостаточно параметров вызова, пропущены: content | Вызов метода без content |
ERROR_ARGUMENT |
The value of an argument 'content' has an invalid type | Параметр content передан в неверном типе |
ACCESS_DENIED |
Недостаточно прав | Пользователь не прошел общие проверки доступа |
insufficient_scope |
Недостаточно scope у токена | Токен не содержит scope landing |

