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

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

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

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

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

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


Пример использования для 1С:Предприятие/OneScript
    Токен = "secret_9RsfMrRMqZwqp0Zl0B...";
База = "29c82aa7-fc4e-8184-8582-da9da081508e";

Результат = OPI_Notion.ПолучитьБазуДанных(Токен, База);
    oint notion ПолучитьБазуДанных \
--token "***" \
--base "29d82aa7-fc4e-8134-9419-cf9344e02e5e"
Результат
{
"object": "database",
"id": "29d82aa7-fc4e-81a7-8f80-c41075ab7e28",
"cover": null,
"icon": null,
"created_time": "2025-10-31T10:08: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-31T10:08: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": "%3DSd%3B",
"name": "Картинка",
"description": null,
"type": "files",
"files": {}
},
"Статус": {
"id": "%3EXnp",
"name": "Статус",
"description": null,
"type": "select",
"select": {
"options": [
{
"id": "75f058d8-678b-422b-9626-3b865c165bed",
"name": "Новый",
"color": "green",
"description": null
},
{
"id": "eb25af38-c71a-47ab-95f4-ce48c742b526",
"name": "В работе",
"color": "yellow",
"description": null
},
{
"id": "e5490f75-d14d-45e0-810a-a95e0e77fb2c",
"name": "Удаленный",
"color": "red",
"description": null
}
]
}
},
"Описание": {
"id": "Ld_s",
"name": "Описание",
"description": null,
"type": "rich_text",
"rich_text": {}
},
"Телефон": {
"id": "LyU%3E",
"name": "Телефон",
"description": null,
"type": "phone_number",
"phone_number": {}
},
"Активен": {
"id": "VJWl",
"name": "Активен",
"description": null,
"type": "checkbox",
"checkbox": {}
},
"Пользователь": {
"id": "YTLk",
"name": "Пользователь",
"description": null,
"type": "people",
"people": {}
},
"Дата создания": {
"id": "umiY",
"name": "Дата создания",
"description": null,
"type": "date",
"date": {}
},
"Почта": {
"id": "y%5CPk",
"name": "Почта",
"description": null,
"type": "rich_text",
"rich_text": {}
},
"Номер": {
"id": "%7D%3Flx",
"name": "Номер",
"description": null,
"type": "number",
"number": {
"format": "number"
}
},
"Имя": {
"id": "title",
"name": "Имя",
"description": null,
"type": "title",
"title": {}
}
},
"parent": {
...