2024-06-05 12:19:46 +02:00
|
|
|
---
|
|
|
|
sidebar_position: 2
|
|
|
|
---
|
|
|
|
|
|
|
|
# Get database
|
|
|
|
Get database information
|
|
|
|
|
|
|
|
|
2024-07-10 10:59:55 +02:00
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
2024-07-10 12:58:29 +02:00
|
|
|
`Function GetDatabase(Val Token, Val Base) Export`
|
2024-06-05 12:19:46 +02:00
|
|
|
|
|
|
|
| Parameter | CLI option | Type | Destination |
|
|
|
|
|-|-|-|-|
|
|
|
|
| Token | --token | String | Token |
|
|
|
|
| Base | --base | String | Database ID |
|
|
|
|
|
|
|
|
|
2024-06-06 14:33:52 +02:00
|
|
|
Returns: Map Of KeyAndValue - Serialized JSON response from Notion
|
2024-06-05 12:19:46 +02:00
|
|
|
|
2024-07-10 13:05:58 +02:00
|
|
|
<br/>
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-07-10 12:58:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
```bsl title="Code example"
|
2024-07-10 13:24:11 +02:00
|
|
|
|
|
|
|
Token = "secret_9RsfMrRMqZwqp0Zl0B...";
|
2024-06-05 12:19:46 +02:00
|
|
|
Base = "048ba0ce4f474e33900540d24...";
|
|
|
|
|
|
|
|
Response = OPI_Notion.GetDatabase(Token, Base);
|
|
|
|
Response = OPI_Tools.JSONString(Response);
|
|
|
|
```
|
2024-07-10 10:59:55 +02:00
|
|
|
|
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
|
|
|
|
```sh title="CLI command example"
|
|
|
|
|
|
|
|
oint notion GetDatabase --token "secret_9RsfMrRMqZwqp0Zl0B..." --base "048ba0ce4f474e33900540d24..."
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
```json title="Result"
|
2024-07-10 13:11:17 +02:00
|
|
|
{
|
2024-06-05 12:19:46 +02:00
|
|
|
"request_id": "9c6e06e9-ffa5-4a3c-b4ff-0368553ca066",
|
|
|
|
"public_url": null,
|
|
|
|
"url": "https://www.notion.so/048ba0ce4f474e33900540d249b01949",
|
|
|
|
"parent": {
|
|
|
|
"page_id": "5dd94c34-fab0-4bff-986b-7511c0779f77",
|
|
|
|
"type": "page_id"
|
|
|
|
},
|
|
|
|
"properties": {
|
|
|
|
"Image": {
|
|
|
|
"files": {},
|
|
|
|
"type": "files",
|
|
|
|
"name": "Image",
|
|
|
|
"id": "r%3Dfa"
|
|
|
|
},
|
|
|
|
"Active": {
|
|
|
|
"checkbox": {},
|
|
|
|
"type": "checkbox",
|
|
|
|
"name": "Active",
|
|
|
|
"id": "q%3FQF"
|
|
|
|
},
|
|
|
|
"Phone": {
|
|
|
|
"phone_number": {},
|
|
|
|
"type": "phone_number",
|
|
|
|
"name": "Phone",
|
|
|
|
"id": "hDII"
|
|
|
|
},
|
|
|
|
"User": {
|
|
|
|
"people": {},
|
|
|
|
"type": "people",
|
|
|
|
"name": "User",
|
|
|
|
"id": "%5D%40Md"
|
|
|
|
},
|
|
|
|
"Description": {
|
|
|
|
"rich_text": {},
|
|
|
|
"type": "rich_text",
|
|
|
|
"name": "Description",
|
|
|
|
"id": "KnG%3F"
|
|
|
|
},
|
|
|
|
"Status": {
|
|
|
|
"select": {
|
|
|
|
"options": [
|
|
|
|
{
|
|
|
|
"description": null,
|
|
|
|
"color": "red",
|
|
|
|
"name": "Remote",
|
|
|
|
"id": "a71d6e8a-4f3e-4dfd-9f0e-4d90e400fde7"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"description": null,
|
|
|
|
"color": "yellow",
|
|
|
|
"name": "InProgress",
|
|
|
|
"id": "aa6300b4-c635-4ab4-b5cd-87d14e45dd11"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"description": null,
|
|
|
|
"color": "green",
|
|
|
|
"name": "New",
|
|
|
|
"id": "202b1d30-2095-40f1-8b91-f627d475d560"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"type": "select",
|
|
|
|
"name": "Status",
|
|
|
|
"id": "IDW%3C"
|
|
|
|
},
|
|
|
|
"Number": {
|
|
|
|
"type": "number",
|
|
|
|
"name": "Number",
|
|
|
|
"number": {
|
|
|
|
"format": "number"
|
|
|
|
},
|
|
|
|
"id": "CH__"
|
|
|
|
},
|
|
|
|
"CreationDate": {
|
|
|
|
"date": {},
|
|
|
|
"type": "date",
|
|
|
|
"name": "CreationDate",
|
|
|
|
"id": "BQN%5B"
|
|
|
|
},
|
|
|
|
"Name": {
|
|
|
|
"title": {},
|
|
|
|
"type": "title",
|
|
|
|
"name": "Name",
|
|
|
|
"id": "title"
|
|
|
|
},
|
|
|
|
"Email": {
|
|
|
|
"rich_text": {},
|
|
|
|
"type": "rich_text",
|
|
|
|
"name": "Email",
|
|
|
|
"id": "%3CO%3AD"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"last_edited_time": "2024-01-26T18:28:00.000Z",
|
|
|
|
"description": [
|
|
|
|
{
|
|
|
|
"plain_text": "Updated base description",
|
|
|
|
"annotations": {
|
|
|
|
"color": "default",
|
|
|
|
"code": false,
|
|
|
|
"underline": false,
|
|
|
|
"strikethrough": false,
|
|
|
|
"italic": false,
|
|
|
|
"bold": false
|
|
|
|
},
|
|
|
|
"text": {
|
|
|
|
"link": null,
|
|
|
|
"content": "Updated base description"
|
|
|
|
},
|
|
|
|
"href": null,
|
|
|
|
"type": "text"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"created_by": {
|
|
|
|
"id": "8b07422e-eeea-40d1-8d5e-c784211825b0",
|
|
|
|
"object": "user"
|
|
|
|
},
|
|
|
|
"archived": false,
|
|
|
|
"icon": null,
|
|
|
|
"created_time": "2024-01-26T16:49:00.000Z",
|
|
|
|
"title": [
|
|
|
|
{
|
|
|
|
"plain_text": "Updated title",
|
|
|
|
"annotations": {
|
|
|
|
"color": "default",
|
|
|
|
"code": false,
|
|
|
|
"underline": false,
|
|
|
|
"strikethrough": false,
|
|
|
|
"italic": false,
|
|
|
|
"bold": false
|
|
|
|
},
|
|
|
|
"text": {
|
|
|
|
"link": null,
|
|
|
|
"content": "Updated title"
|
|
|
|
},
|
|
|
|
"href": null,
|
|
|
|
"type": "text"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"cover": null,
|
|
|
|
"is_inline": false,
|
|
|
|
"id": "048ba0ce-4f47-4e33-9005-40d249b01949",
|
|
|
|
"last_edited_by": {
|
|
|
|
"id": "ed71865a-9891-46bc-86cd-a92aa499cfdb",
|
|
|
|
"object": "user"
|
|
|
|
},
|
|
|
|
"object": "database"
|
|
|
|
}
|
|
|
|
```
|