note.collection.get
Получить базу знаний
Описание
Метод относится к REST 3.0. Особенности вызова и формат ответа новой версии API описаны в обзоре REST 3.0.
Метод note.collection.get возвращает базу знаний по идентификатору.
Параметры
id
integer
обязательный
Идентификатор базы знаний.
Идентификатор можно получить методом note.collection.list
Примеры запроса
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"id":42}' \
https://**put_your_bitrix24_address**/rest/api/**put_your_user_id_here**/**put_your_webhook_here**/note.collection.get
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"id":42,"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/api/note.collection.get
import { Text } from '@bitrix24/b24jssdk'
import type { B24Frame, ISODate } from '@bitrix24/b24jssdk'
declare const $b24: B24Frame
type CollectionGetResult = {
item: {
id: number
name: string
position: number
policyLevel: string
createdBy: number
updatedBy: number
createdAt: ISODate
updatedAt: ISODate
}
}
try {
const response = await $b24.actions.v3.call.make<CollectionGetResult>({
method: 'note.collection.get',
params: {
id: 42,
},
requestId: Text.getUuidRfc4122()
})
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
} else {
const result = response.getData()!.result
console.info('Collection name:', result.item.name)
}
} catch (error) {
console.error(error)
}
<script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
<script>
async function getCollection() {
try {
const $b24 = await B24Js.initializeB24Frame()
const response = await $b24.actions.v3.call.make({
method: 'note.collection.get',
params: {
id: 42,
},
requestId: B24Js.Text.getUuidRfc4122()
})
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
return
}
const result = response.getData().result
console.info('Collection name:', result.item.name)
} catch (error) {
console.error(error)
}
}
document.addEventListener('DOMContentLoaded', getCollection)
</script>
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
try:
bitrix_response = client.note.collection.get(
bitrix_id=42,
).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(
'note.collection.get',
[
'id' => 42,
]
);
$result = $response
->getResponseData()
->getResult();
echo 'Success: ' . print_r($result, true);
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error getting collection: ' . $e->getMessage();
}
BX24.callMethod(
'note.collection.get',
{
id: 42
},
function(result){
console.info(result.data());
console.log(result);
}
);
require_once('crest.php');
$result = CRest::call(
'note.collection.get',
[
'id' => 42
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
// client и ctx уже созданы — см. раздел «SDK для Go»
res, err := client.Core().Call(ctx, "note.collection.get", b24.Params{
"id": 42,
}, b24.WithIdempotent())
if err != nil {
return fmt.Errorf("note.collection.get: %w", err)
}
// Метод заворачивает ответ в объект с ключом "item".
raw, ok := b24.Unwrap(res.Result, "item")
if !ok {
return fmt.Errorf("в ответе нет ключа item")
}
var item struct {
ID b24.ID `json:"id"`
Name string `json:"name"`
Position int `json:"position"`
PolicyLevel string `json:"policyLevel"`
CreatedBy int `json:"createdBy"`
CreatedAt string `json:"createdAt"`
}
if err := json.Unmarshal(raw, &item); err != nil {
return fmt.Errorf("разбор ответа: %w", err)
}
fmt.Println(item.ID, item.Name)
Ответ
HTTP-статус: 200
{
"result": {
"item": {
"id": 42,
"name": "Продуктовая документация",
"position": 100,
"policyLevel": "manage",
"createdBy": 1,
"createdAt": "2026-04-20T12:00:00Z",
"updatedBy": 1,
"updatedAt": "2026-04-21T09:15:30Z"
}
},
"time": {
"start": 1780640400,
"finish": 1780640400.215441,
"duration": 0.21544098854064941,
"processing": 0.1772141456604004,
"date_start": "2026-06-19T10:20:00+03:00",
"date_finish": "2026-06-19T10:20:00+03:00",
"operating_reset_at": 1780641000,
"operating": 0
}
}
Возвращаемые данные
result
object
Объект с данными базы знаний
item
object
Объект базы знаний
id
integer
Идентификатор базы знаний
name
string
Название базы знаний
position
integer
Позиция базы знаний в общем списке
policyLevel
string
Базовая политика доступа базы знаний.
Возможные значения:
none— нет доступаview— просмотрmanage— редактированиеmoderate— администрирование
createdBy
integer
Идентификатор автора базы знаний
createdAt
datetime
Дата и время создания базы знаний в UTC
updatedBy
integer
Идентификатор последнего редактора базы знаний
updatedAt
datetime
Дата и время последнего изменения базы знаний в UTC
time
time
Информация о времени выполнения запроса
Обработка ошибок
HTTP-статус: 400
{
"error": {
"code": "BITRIX_REST_V3_EXCEPTION_VALIDATION_REQUESTVALIDATIONEXCEPTION",
"message": "Ошибка при валидации объекта запроса",
"validation": [
{
"message": "Обязательное поле `id` не указано",
"field": "id"
}
]
}
}
| Код | Описание | Значение |
|---|---|---|
Поле |
Описание ошибки | Как исправить |
id |
Обязательное поле id не указано |
Добавьте id в тело запроса |
id |
В поле id требуется тип данных #TYPE# для такого запроса |
Убедитесь, что передаваемое значение нужного типа |

