2024-06-05 10:19:46 +00:00
|
|
|
---
|
|
|
|
sidebar_position: 2
|
|
|
|
---
|
|
|
|
|
|
|
|
# Get database
|
|
|
|
Get database information
|
|
|
|
|
|
|
|
|
2024-07-10 11:59:55 +03:00
|
|
|
|
2024-07-10 13:58:29 +03:00
|
|
|
`Function GetDatabase(Val Token, Val Base) Export`
|
2024-06-05 10:19:46 +00:00
|
|
|
|
2024-08-13 15:52:26 +03:00
|
|
|
| Parameter | CLI option | Type | Description |
|
|
|
|
|-|-|-|-|
|
|
|
|
| Token | --token | String | Token |
|
|
|
|
| Base | --base | String | Database ID |
|
2024-06-05 10:19:46 +00:00
|
|
|
|
2024-08-13 15:52:26 +03:00
|
|
|
|
|
|
|
Returns: Map Of KeyAndValue - Serialized JSON response from Notion
|
2024-06-05 10:19:46 +00:00
|
|
|
|
2024-07-10 14:05:58 +03:00
|
|
|
<br/>
|
2024-07-10 11:59:55 +03:00
|
|
|
|
2024-07-10 13:58:29 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-05 10:19:46 +00:00
|
|
|
```bsl title="Code example"
|
2024-10-01 21:08:09 +03:00
|
|
|
Token = "secret_9RsfMrRMqZwqp0Zl0B...";
|
|
|
|
Base = "11282aa7-fc4e-810b-ab77-cef5a2a3443e";
|
|
|
|
|
|
|
|
Result = OPI_Notion.GetDatabase(Token, Base);
|
2024-06-05 10:19:46 +00:00
|
|
|
```
|
2024-08-13 15:52:26 +03:00
|
|
|
|
2024-07-10 11:59:55 +03:00
|
|
|
|
2024-06-05 10:19:46 +00:00
|
|
|
|
|
|
|
```sh title="CLI command example"
|
2024-08-13 15:52:26 +03:00
|
|
|
|
|
|
|
oint notion GetDatabase --token "secret_9RsfMrRMqZwqp0Zl0B..." --base "048ba0ce4f474e33900540d24..."
|
2024-06-05 10:19:46 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
```json title="Result"
|
2024-10-02 10:03:52 +03:00
|
|
|
{
|
|
|
|
"object": "database",
|
2024-10-06 16:55:08 +03:00
|
|
|
"id": "11682aa7-fc4e-81c3-8fd1-d37ac3ba1753",
|
2024-10-02 10:03:52 +03:00
|
|
|
"cover": null,
|
|
|
|
"icon": null,
|
2024-10-06 16:55:08 +03:00
|
|
|
"created_time": "2024-10-05T15:00: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-06 16:55:08 +03:00
|
|
|
"last_edited_time": "2024-10-05T15:00: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-06 16:55:08 +03:00
|
|
|
"Active": {
|
|
|
|
"id": "%3A%7CmJ",
|
|
|
|
"name": "Active",
|
|
|
|
"type": "checkbox",
|
|
|
|
"checkbox": {}
|
2024-10-02 10:03:52 +03:00
|
|
|
},
|
2024-10-02 20:28:02 +03:00
|
|
|
"User": {
|
2024-10-06 16:55:08 +03:00
|
|
|
"id": "KEwF",
|
2024-10-02 20:28:02 +03:00
|
|
|
"name": "User",
|
|
|
|
"type": "people",
|
|
|
|
"people": {}
|
|
|
|
},
|
|
|
|
"CreationDate": {
|
2024-10-06 16:55:08 +03:00
|
|
|
"id": "KYy%40",
|
2024-10-02 20:28:02 +03:00
|
|
|
"name": "CreationDate",
|
|
|
|
"type": "date",
|
|
|
|
"date": {}
|
|
|
|
},
|
2024-10-06 16:55:08 +03:00
|
|
|
"Image": {
|
|
|
|
"id": "KlBb",
|
|
|
|
"name": "Image",
|
|
|
|
"type": "files",
|
|
|
|
"files": {}
|
|
|
|
},
|
|
|
|
"Phone": {
|
|
|
|
"id": "Mn%40p",
|
|
|
|
"name": "Phone",
|
|
|
|
"type": "phone_number",
|
|
|
|
"phone_number": {}
|
|
|
|
},
|
|
|
|
"Number": {
|
|
|
|
"id": "s%5DAT",
|
|
|
|
"name": "Number",
|
|
|
|
"type": "number",
|
|
|
|
"number": {
|
|
|
|
"format": "number"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"Description": {
|
|
|
|
"id": "t%3A%3BO",
|
|
|
|
"name": "Description",
|
|
|
|
"type": "rich_text",
|
|
|
|
"rich_text": {}
|
|
|
|
},
|
|
|
|
"Email": {
|
|
|
|
"id": "u~I%3E",
|
|
|
|
"name": "Email",
|
|
|
|
"type": "rich_text",
|
|
|
|
"rich_text": {}
|
|
|
|
},
|
2024-10-02 10:03:52 +03:00
|
|
|
"Status": {
|
2024-10-06 16:55:08 +03:00
|
|
|
"id": "vQA%5C",
|
2024-10-02 10:03:52 +03:00
|
|
|
"name": "Status",
|
|
|
|
"type": "select",
|
|
|
|
"select": {
|
|
|
|
"options": [
|
|
|
|
{
|
2024-10-06 16:55:08 +03:00
|
|
|
"id": "8692b38e-14c8-45b8-93f7-052193de1c9f",
|
2024-10-02 10:03:52 +03:00
|
|
|
"name": "New",
|
|
|
|
"color": "green",
|
|
|
|
"description": null
|
|
|
|
},
|
|
|
|
{
|
2024-10-06 16:55:08 +03:00
|
|
|
"id": "896c91b1-1e18-4e01-b8cc-3677cbd658c5",
|
2024-10-02 10:03:52 +03:00
|
|
|
"name": "InProgress",
|
|
|
|
"color": "yellow",
|
|
|
|
"description": null
|
|
|
|
},
|
|
|
|
{
|
2024-10-06 16:55:08 +03:00
|
|
|
"id": "1ea22363-d54a-437c-8228-f570440dc8d1",
|
2024-10-02 10:03:52 +03:00
|
|
|
"name": "Remote",
|
|
|
|
"color": "red",
|
|
|
|
"description": null
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"Name": {
|
|
|
|
"id": "title",
|
|
|
|
"name": "Name",
|
|
|
|
"type": "title",
|
|
|
|
"title": {}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"parent": {
|
|
|
|
"type": "page_id",
|
|
|
|
"page_id": "5dd94c34-fab0-4bff-986b-7511c0779f77"
|
|
|
|
},
|
2024-10-06 16:55:08 +03:00
|
|
|
"url": "https://www.notion.so/11682aa7fc4e81c38fd1d37ac3ba1753",
|
2024-10-02 10:03:52 +03:00
|
|
|
"public_url": null,
|
|
|
|
"archived": false,
|
|
|
|
"in_trash": false,
|
2024-10-06 16:55:08 +03:00
|
|
|
"request_id": "98468202-e059-4ca4-93ca-7d6af5c9e006"
|
2024-10-02 10:03:52 +03:00
|
|
|
}
|
2024-06-05 10:19:46 +00:00
|
|
|
```
|