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

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

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

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

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

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


Пример использования для 1С:Предприятие/OneScript
    Токен = "secret_9RsfMrRMqZwqp0Zl0B...";
База = "26e82aa7-fc4e-81d1-af10-fbd1542ade36";

Результат = OPI_Notion.ПолучитьБазуДанных(Токен, База);
    oint notion ПолучитьБазуДанных \
--token "***" \
--base "27082aa7-fc4e-81b7-8fe3-d87406684e60"
Результат
{
"object": "database",
"id": "27082aa7-fc4e-81b7-8fe3-d87406684e60",
"cover": null,
"icon": null,
"created_time": "2025-09-16T04:45: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-09-16T04:45: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": "%3ARN%3C",
"name": "Активен",
"description": null,
"type": "checkbox",
"checkbox": {}
},
"Статус": {
"id": "KX%3C%5C",
"name": "Статус",
"description": null,
"type": "select",
"select": {
"options": [
{
"id": "cb8e4300-45ba-4e21-99bc-61a11aeb6827",
"name": "Новый",
"color": "green",
"description": null
},
{
"id": "4cc11a34-eb50-4eb4-ba89-14126cde888d",
"name": "В работе",
"color": "yellow",
"description": null
},
{
"id": "2e6428e4-5201-47c9-85c8-f45e70891647",
"name": "Удаленный",
"color": "red",
"description": null
}
]
}
},
"Описание": {
"id": "LFcP",
"name": "Описание",
"description": null,
"type": "rich_text",
"rich_text": {}
},
"Пользователь": {
"id": "NOMv",
"name": "Пользователь",
"description": null,
"type": "people",
"people": {}
},
"Телефон": {
"id": "S%7CNg",
"name": "Телефон",
"description": null,
"type": "phone_number",
"phone_number": {}
},
"Почта": {
"id": "dxl%3D",
"name": "Почта",
"description": null,
"type": "rich_text",
"rich_text": {}
},
"Картинка": {
"id": "vggN",
"name": "Картинка",
"description": null,
"type": "files",
"files": {}
},
"Номер": {
"id": "y%3D%5E%3F",
"name": "Номер",
"description": null,
"type": "number",
"number": {
"format": "number"
}
},
"Дата создания": {
"id": "yjVM",
"name": "Дата создания",
"description": null,
"type": "date",
"date": {}
},
"Имя": {
"id": "title",
"name": "Имя",
"description": null,
"type": "title",
"title": {}
}
},
"parent": {
...