Перейти к основному содержимому

Получить базу данных

Получить данные о базе данных

Функция ПолучитьБазуДанных(Знач Токен, Знач База) Экспорт

ПараметрCLI опцияТипОбяз.Назначение
Токен--tokenСтрокаТокен
База--baseСтрокаID базы данных

Возвращаемое значение: Соответствие Из КлючИЗначение - сериализованный JSON ответа от Notion


Пример использования для 1С:Предприятие/OneScript
    Токен = "secret_9RsfMrRMqZwqp0Zl0B...";
База = "28c82aa7-fc4e-812a-85a6-d7e18ec38bd2";

Результат = OPI_Notion.ПолучитьБазуДанных(Токен, База);
    oint notion ПолучитьБазуДанных \
--token "***" \
--base "28c82aa7-fc4e-8104-a975-db38faae17c9"
Результат
{
"object": "database",
"id": "28c82aa7-fc4e-816c-9550-f7da147bea23",
"cover": null,
"icon": null,
"created_time": "2025-10-14T16:56:00Z",
"created_by": {
"object": "user",
"id": "8b07422e-eeea-40d1-8d5e-c784211825b0"
},
"last_edited_by": {
"object": "user",
"id": "8b07422e-eeea-40d1-8d5e-c784211825b0"
},
"last_edited_time": "2025-10-14T16:56:00Z",
"title": [
{
"type": "text",
"text": {
"content": "Тестовый заголовок",
"link": null
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "Тестовый заголовок",
"href": null
}
],
"description": [
{
"type": "text",
"text": {
"content": "Тестовое описание",
"link": null
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "Тестовое описание",
"href": null
}
],
"is_inline": false,
"properties": {
"Номер": {
"id": "GO%7C%5E",
"name": "Номер",
"description": null,
"type": "number",
"number": {
"format": "number"
}
},
"Дата создания": {
"id": "HeTg",
"name": "Дата создания",
"description": null,
"type": "date",
"date": {}
},
"Статус": {
"id": "OI~Y",
"name": "Статус",
"description": null,
"type": "select",
"select": {
"options": [
{
"id": "3c6ab5e0-06a7-4871-8007-1051d9ce8aca",
"name": "Новый",
"color": "green",
"description": null
},
{
"id": "2c47e88f-8085-41d4-afcf-edafd1efc879",
"name": "В работе",
"color": "yellow",
"description": null
},
{
"id": "73dcbdc4-75e6-459f-8094-bdd9c6ff6a3a",
"name": "Удаленный",
"color": "red",
"description": null
}
]
}
},
"Телефон": {
"id": "bIwP",
"name": "Телефон",
"description": null,
"type": "phone_number",
"phone_number": {}
},
"Активен": {
"id": "bpEo",
"name": "Активен",
"description": null,
"type": "checkbox",
"checkbox": {}
},
"Почта": {
"id": "b%7D%7BG",
"name": "Почта",
"description": null,
"type": "rich_text",
"rich_text": {}
},
"Картинка": {
"id": "chQD",
"name": "Картинка",
"description": null,
"type": "files",
"files": {}
},
"Описание": {
"id": "gUJJ",
"name": "Описание",
"description": null,
"type": "rich_text",
"rich_text": {}
},
"Пользователь": {
"id": "%7DXgm",
"name": "Пользователь",
"description": null,
"type": "people",
"people": {}
},
"Имя": {
"id": "title",
"name": "Имя",
"description": null,
"type": "title",
"title": {}
}
},
"parent": {
...