1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-12-03 22:39:12 +02:00
Files
OpenIntegrations/docs/en/md/Notion/Database-management/Get-database.mdx

210 lines
4.1 KiB
Plaintext
Raw Normal View History

2024-10-15 10:50:56 +03:00
---
2024-10-15 10:16:04 +03:00
sidebar_position: 2
2025-05-05 11:15:20 +03:00
description: Get database and other functions to work with Notion in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
2025-05-05 09:49:19 +03:00
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Notion]
2024-10-15 10:16:04 +03:00
---
2024-10-15 10:50:56 +03:00
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2024-10-15 10:16:04 +03:00
# Get database
Get database information
`Function GetDatabase(Val Token, Val Base) Export`
2024-10-15 15:15:47 +03:00
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Token | --token | String | ✔ | Token |
| Base | --base | String | ✔ | Database ID |
2024-10-15 10:16:04 +03:00
Returns: Map Of KeyAndValue - serialized JSON response from Notion
<br/>
2024-10-15 21:15:56 +03:00
```bsl title="1C:Enterprise/OneScript code example"
2025-06-29 14:35:33 +03:00
Token = "secret_9RsfMrRMqZwqp0Zl0B...";
2025-09-15 13:14:53 +03:00
Base = "26e82aa7-fc4e-81d1-af10-fbd1542ade36";
2024-10-15 10:16:04 +03:00
Result = OPI_Notion.GetDatabase(Token, Base);
```
2024-10-20 22:36:03 +03:00
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint notion GetDatabase \
2024-10-22 08:59:24 +03:00
--token "***" \
2025-09-16 09:07:33 +03:00
--base "26f82aa7-fc4e-8100-8c40-ec5a1dfa460e"
2024-10-20 22:36:03 +03:00
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint notion GetDatabase ^
2024-10-22 08:59:24 +03:00
--token "***" ^
2025-09-16 09:07:33 +03:00
--base "26f82aa7-fc4e-8100-8c40-ec5a1dfa460e"
2024-10-20 22:36:03 +03:00
```
</TabItem>
</Tabs>
2024-10-15 10:16:04 +03:00
```json title="Result"
{
"object": "database",
2025-09-16 09:07:33 +03:00
"id": "26f82aa7-fc4e-8100-8c40-ec5a1dfa460e",
2024-10-15 10:16:04 +03:00
"cover": null,
"icon": null,
2025-09-16 09:07:33 +03:00
"created_time": "2025-09-15T22:34:00Z",
2024-10-15 10:16:04 +03:00
"created_by": {
"object": "user",
"id": "8b07422e-eeea-40d1-8d5e-c784211825b0"
},
"last_edited_by": {
"object": "user",
"id": "8b07422e-eeea-40d1-8d5e-c784211825b0"
},
2025-09-16 09:07:33 +03:00
"last_edited_time": "2025-09-15T22:34:00Z",
2024-10-15 10:16:04 +03:00
"title": [
{
"type": "text",
"text": {
"content": "TestTitle",
"link": null
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "TestTitle",
"href": null
}
],
"description": [
{
"type": "text",
"text": {
"content": "TestDescription",
"link": null
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "TestDescription",
"href": null
}
],
"is_inline": false,
"properties": {
2025-09-15 13:14:53 +03:00
"Email": {
2025-09-16 09:07:33 +03:00
"id": "%3AGLR",
2025-09-15 13:14:53 +03:00
"name": "Email",
2025-09-12 20:23:31 +03:00
"description": null,
"type": "rich_text",
"rich_text": {}
},
2025-09-16 09:07:33 +03:00
"User": {
"id": "%40lUr",
"name": "User",
2025-09-12 20:23:31 +03:00
"description": null,
2025-09-16 09:07:33 +03:00
"type": "people",
"people": {}
2024-10-15 10:16:04 +03:00
},
2025-09-15 13:14:53 +03:00
"Description": {
2025-09-16 09:07:33 +03:00
"id": "OQ_%60",
2025-09-15 13:14:53 +03:00
"name": "Description",
"description": null,
"type": "rich_text",
"rich_text": {}
},
2024-10-15 10:16:04 +03:00
"Status": {
2025-09-16 09:07:33 +03:00
"id": "Qt%5EW",
2024-10-15 10:16:04 +03:00
"name": "Status",
2025-09-12 20:23:31 +03:00
"description": null,
2024-10-15 10:16:04 +03:00
"type": "select",
"select": {
"options": [
{
2025-09-16 09:07:33 +03:00
"id": "d6f95a10-9a0e-492a-84a9-762c1e53901d",
2024-10-15 10:16:04 +03:00
"name": "New",
"color": "green",
"description": null
},
{
2025-09-16 09:07:33 +03:00
"id": "06d8c6ba-4e47-49cf-a961-982919bdf175",
2024-10-15 10:16:04 +03:00
"name": "InProgress",
"color": "yellow",
"description": null
},
{
2025-09-16 09:07:33 +03:00
"id": "996d1095-8156-494a-b27b-71979d9a61c5",
2024-10-15 10:16:04 +03:00
"name": "Remote",
"color": "red",
"description": null
}
]
}
},
2025-09-16 09:07:33 +03:00
"Number": {
"id": "%5DJaU",
"name": "Number",
"description": null,
"type": "number",
"number": {
"format": "number"
}
},
"CreationDate": {
"id": "%5EeGi",
"name": "CreationDate",
"description": null,
"type": "date",
"date": {}
},
"Phone": {
"id": "bX%3CC",
"name": "Phone",
"description": null,
"type": "phone_number",
"phone_number": {}
},
"Image": {
"id": "h%3D%3Bs",
"name": "Image",
"description": null,
"type": "files",
"files": {}
},
"Active": {
"id": "~Y%3Cb",
"name": "Active",
"description": null,
"type": "checkbox",
"checkbox": {}
},
2024-10-15 10:16:04 +03:00
"Name": {
"id": "title",
"name": "Name",
2025-09-12 20:23:31 +03:00
"description": null,
2024-10-15 10:16:04 +03:00
"type": "title",
"title": {}
}
},
"parent": {
2025-09-12 20:23:31 +03:00
...
2024-10-15 10:16:04 +03:00
```