لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/entities/sites/menu-bindings/list.md فهرس التوثيق — /llms.txt
مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.
List knowledge base menu bindings
GET /v1/sites/menu-bindings
Returns knowledge base bindings to Bitrix24 account menu items, either all at once or for a single menu code.
Site type restrictions and how a binding changes the employees' menu are covered in Knowledge base menu bindings.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ParametermenuCode (query) |
Typestring | Requiredno | DescriptionMenu code, for example crm_switcher:lead. Encode the colon in the URL as %3A. An empty value returns 400 INVALID_PARAMS. Without the parameter, bindings to all menus are returned |
Parameterscope (query) |
Typestring | Requiredno | DescriptionSite scope: KNOWLEDGE, GROUP or MAINPAGE. Any other value returns 400 INVALID_SCOPE |
There is no pagination: the response contains all bindings matching the filter in a single array. The limit and offset parameters are not processed.
Examples
curl — personal key
curl "https://vibecode.bitrix24.com/v1/sites/menu-bindings?menuCode=crm_switcher%3Alead" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl "https://vibecode.bitrix24.com/v1/sites/menu-bindings?menuCode=crm_switcher%3Alead" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN"
JavaScript — personal key
const params = new URLSearchParams({ menuCode: 'crm_switcher:lead' })
const res = await fetch(`https://vibecode.bitrix24.com/v1/sites/menu-bindings?${params}`, {
headers: {
'X-Api-Key': 'YOUR_API_KEY',
},
})
const { success, data } = await res.json()
console.log(`Bindings: ${data.length}`)
JavaScript — OAuth application
const params = new URLSearchParams({ menuCode: 'crm_switcher:lead' })
const res = await fetch(`https://vibecode.bitrix24.com/v1/sites/menu-bindings?${params}`, {
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
const { success, data } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionAlways true on success |
Fielddata |
Typearray | DescriptionArray of bindings. Empty array if no bindings match the filter |
Fielddata[].siteId |
Typenumber | DescriptionKnowledge base site ID. Get the site: GET /v1/sites/:id?scope=KNOWLEDGE |
Fielddata[].menuCode |
Typestring | DescriptionCode of the menu the site is bound to |
Fielddata[].title |
Typestring | DescriptionSite title. Empty string if the title was not returned |
Fielddata[].publicUrl |
Typestring | DescriptionPublic URL of the knowledge base site. Empty string if the URL was not returned |
Response example
{
"success": true,
"data": [
{
"siteId": 61,
"menuCode": "crm_switcher:lead",
"title": "Knowledge base",
"publicUrl": "https://example.bitrix24.com/knowledge/knowledge_base/"
},
{
"siteId": 131,
"menuCode": "crm_switcher:lead",
"title": "Support knowledge base",
"publicUrl": "https://example.bitrix24.com/knowledge/support_knowledge_base/"
}
]
}
Error response example
400 — empty menuCode value:
{
"success": false,
"error": {
"code": "INVALID_PARAMS",
"message": "menuCode must be a non-empty string"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeINVALID_PARAMS |
DescriptionmenuCode is empty or whitespace only |
| HTTP400 | CodeINVALID_SCOPE |
Descriptionscope is not KNOWLEDGE, GROUP or MAINPAGE |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 returned the bindings list in an unexpected format |
| HTTP403 | CodeBITRIX_ACCESS_DENIED |
DescriptionBitrix24 denied access to the key owner |
| HTTP403 | CodeB24_TARIFF_RESTRICTION |
DescriptionThe portal plan does not allow the call |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe API key does not have the landing scope |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe API key has no configured tokens |
| HTTP429 | CodeRATE_LIMITED |
DescriptionBitrix24 throttled requests to the portal. Retry after the period from the Retry-After header |
| HTTP502 | CodeBITRIX_UNAVAILABLE |
DescriptionBitrix24 returned a server error or the connection dropped before the full response. The request only reads data, so a retry is safe |
| HTTP503 | CodeBITRIX_TIMEOUT |
DescriptionBitrix24 did not respond in time. The request only reads data, so a retry is safe |
Full list of common API errors — Errors.
Known specifics
One menu code, several sites. Several knowledge bases can be bound to one menu, and each binding comes as a separate array element with the same menuCode. One site can also be bound to several menus.
The list contains only site bindings. Bindings of individual knowledge base pages to a menu are not included in the response, so siteId always points to a site, not a page.