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

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

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

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

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

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

Пример использования для 1С:Предприятие/OneScript
Токен = "secret_9RsfMrRMqZwqp0Zl0B...";
База = "29d82aa7-fc4e-8173-83c3-eef87a456cc4";

Результат = OPI_Notion.ПолучитьБазуДанных(Токен, База);
oint notion ПолучитьБазуДанных \
--token "***" \
--base "38382aa7-fc4e-8145-b8ba-ecac552ec4ff"
Результат
{
"object": "database",
"id": "38382aa7-fc4e-8185-99d6-d7c2c6b17562",
"cover": null,
"icon": null,
"created_time": "2026-06-18T18:17: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": "2026-06-18T18:17: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": "%3AQ%5EB",
"name": "Пользователь",
"description": null,
"type": "people",
"people": {}
},
"Статус": {
"id": "BCer",
"name": "Статус",
"description": null,
"type": "select",
"select": {
"options": [
{
"id": "dc262348-9c3b-4122-acde-877e6611fc95",
"name": "Новый",
"color": "green",
"description": null
},
{
"id": "6ee697a8-2f24-400a-9744-3994d5f4d42e",
"name": "В работе",
"color": "yellow",
"description": null
},
{
"id": "2a9a3af7-74a9-4c6e-9492-259a862fccf7",
"name": "Удаленный",
"color": "red",
"description": null
}
]
}
},
"Дата создания": {
"id": "SpJA",
"name": "Дата создания",
"description": null,
"type": "date",
"date": {}
},
"Описание": {
"id": "%5B%5BaY",
"name": "Описание",
"description": null,
"type": "rich_text",
"rich_text": {}
},
"Телефон": {
"id": "%5ECKL",
"name": "Телефон",
"description": null,
"type": "phone_number",
"phone_number": {}
},
"Активен": {
"id": "nxw%7B",
"name": "Активен",
"description": null,
"type": "checkbox",
"checkbox": {}
},
"Номер": {
"id": "qna%5E",
"name": "Номер",
"description": null,
"type": "number",
"number": {
"format": "number"
}
},
"Почта": {
"id": "yftE",
"name": "Почта",
"description": null,
"type": "rich_text",
"rich_text": {}
},
"Картинка": {
"id": "%7BB%3BB",
"name": "Картинка",
"description": null,
"type": "files",
"files": {}
},
"Имя": {
"id": "title",
"name": "Имя",
"description": null,
"type": "title",
"title": {}
}
},
"parent": {
...