1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-04-23 12:18:48 +02:00

186 lines
3.5 KiB
Markdown
Raw Normal View History

---
sidebar_position: 2
---
# Get database
Get database information
2024-07-10 13:58:29 +03:00
`Function GetDatabase(Val Token, Val Base) Export`
| Parameter | CLI option | Type | Description |
|-|-|-|-|
| Token | --token | String | Token |
| Base | --base | String | Database ID |
2024-10-09 09:42:00 +03:00
Returns: Map Of KeyAndValue - serialized JSON response from Notion
2024-07-10 14:05:58 +03:00
<br/>
2024-07-10 13:58:29 +03:00
```bsl title="Code example"
2024-10-01 21:08:09 +03:00
Token = "secret_9RsfMrRMqZwqp0Zl0B...";
2024-10-15 10:07:27 +03:00
Base = "11e82aa7-fc4e-816a-9812-fcc332821c4a";
2024-10-01 21:08:09 +03:00
Result = OPI_Notion.GetDatabase(Token, Base);
```
2024-10-15 09:53:37 +03:00
```json title="Result"
2024-10-02 10:03:52 +03:00
{
"object": "database",
2024-10-09 09:42:00 +03:00
"id": "11a82aa7-fc4e-8138-a724-ee8786147d82",
2024-10-02 10:03:52 +03:00
"cover": null,
"icon": null,
2024-10-09 09:42:00 +03:00
"created_time": "2024-10-09T06:14:00Z",
2024-10-02 10:03:52 +03:00
"created_by": {
"object": "user",
"id": "8b07422e-eeea-40d1-8d5e-c784211825b0"
},
"last_edited_by": {
"object": "user",
"id": "8b07422e-eeea-40d1-8d5e-c784211825b0"
},
2024-10-09 09:42:00 +03:00
"last_edited_time": "2024-10-09T06:14:00Z",
2024-10-02 10:03:52 +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": {
2024-10-09 09:42:00 +03:00
"Description": {
"id": "%3COFd",
"name": "Description",
"type": "rich_text",
"rich_text": {}
},
2024-10-06 16:55:08 +03:00
"Phone": {
2024-10-09 09:42:00 +03:00
"id": "Ne%7DI",
2024-10-06 16:55:08 +03:00
"name": "Phone",
"type": "phone_number",
"phone_number": {}
},
2024-10-08 20:15:58 +03:00
"CreationDate": {
2024-10-09 09:42:00 +03:00
"id": "P%3Doo",
2024-10-08 20:15:58 +03:00
"name": "CreationDate",
"type": "date",
"date": {}
2024-10-06 16:55:08 +03:00
},
2024-10-09 09:42:00 +03:00
"Active": {
"id": "Ub%7C%5D",
"name": "Active",
"type": "checkbox",
"checkbox": {}
},
"Number": {
"id": "%5Dotl",
"name": "Number",
"type": "number",
"number": {
"format": "number"
}
},
"Email": {
"id": "%60%7DN%3F",
"name": "Email",
2024-10-06 16:55:08 +03:00
"type": "rich_text",
"rich_text": {}
},
2024-10-02 10:03:52 +03:00
"Status": {
2024-10-09 09:42:00 +03:00
"id": "bAZ%7D",
2024-10-02 10:03:52 +03:00
"name": "Status",
"type": "select",
"select": {
"options": [
{
2024-10-09 09:42:00 +03:00
"id": "0e626378-0386-4985-88de-b747968504e7",
2024-10-02 10:03:52 +03:00
"name": "New",
"color": "green",
"description": null
},
{
2024-10-09 09:42:00 +03:00
"id": "e9a7ad5c-196f-4b2a-b2de-e84e849f2183",
2024-10-02 10:03:52 +03:00
"name": "InProgress",
"color": "yellow",
"description": null
},
{
2024-10-09 09:42:00 +03:00
"id": "1b214a08-6768-4381-b3cb-d8dd88250f8c",
2024-10-02 10:03:52 +03:00
"name": "Remote",
"color": "red",
"description": null
}
]
}
},
2024-10-08 20:15:58 +03:00
"User": {
2024-10-09 09:42:00 +03:00
"id": "%7B%3Bsu",
2024-10-08 20:15:58 +03:00
"name": "User",
"type": "people",
"people": {}
},
"Image": {
2024-10-09 09:42:00 +03:00
"id": "%7B%3F%5B%3F",
2024-10-08 20:15:58 +03:00
"name": "Image",
"type": "files",
"files": {}
},
2024-10-02 10:03:52 +03:00
"Name": {
"id": "title",
"name": "Name",
"type": "title",
"title": {}
}
},
"parent": {
"type": "page_id",
"page_id": "5dd94c34-fab0-4bff-986b-7511c0779f77"
},
2024-10-09 09:42:00 +03:00
"url": "https://www.notion.so/11a82aa7fc4e8138a724ee8786147d82",
2024-10-02 10:03:52 +03:00
"public_url": null,
"archived": false,
"in_trash": false,
2024-10-09 09:42:00 +03:00
"request_id": "6bee1b66-c2c7-47c4-96a3-54c83460045a"
2024-10-02 10:03:52 +03:00
}
```