2024-06-05 10:19:46 +00:00
|
|
|
---
|
|
|
|
|
sidebar_position: 1
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
# Create database
|
|
|
|
|
Creates a database
|
|
|
|
|
|
|
|
|
|
|
2024-07-10 11:59:55 +03:00
|
|
|
|
2024-07-10 13:58:29 +03:00
|
|
|
`Function CreateDatabase(Val Token, Val Parent, Val Title, Val Properties = "") 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 |
|
|
|
|
|
| Parent | --page | String | Parent page ID |
|
|
|
|
|
| Title | --title | String | Database title |
|
|
|
|
|
| Properties | --props | Structure Of String | Database properties |
|
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...";
|
|
|
|
|
Parent = "5dd94c34fab04bff986b7511c0779f77";
|
|
|
|
|
Title = "TestTitle";
|
|
|
|
|
|
|
|
|
|
Properties = New Map;
|
|
|
|
|
Properties.Insert("Name" , "title");
|
|
|
|
|
Properties.Insert("Description" , "rich_text");
|
|
|
|
|
Properties.Insert("Number" , "number");
|
|
|
|
|
Properties.Insert("Status" , "status");
|
|
|
|
|
Properties.Insert("CreationDate" , "date");
|
|
|
|
|
Properties.Insert("Image" , "files");
|
|
|
|
|
Properties.Insert("Active" , "checkbox");
|
|
|
|
|
Properties.Insert("Website" , "url");
|
|
|
|
|
Properties.Insert("Email" , "email");
|
|
|
|
|
Properties.Insert("Phone" , "phone_number");
|
|
|
|
|
Properties.Insert("User" , "people");
|
|
|
|
|
|
|
|
|
|
ValueSelection = New Map;
|
|
|
|
|
ValueSelection.Insert("New" , "green");
|
|
|
|
|
ValueSelection.Insert("InProgress" , "yellow");
|
|
|
|
|
ValueSelection.Insert("Remote" , "red");
|
|
|
|
|
|
|
|
|
|
Properties.Insert("Status", ValueSelection);
|
|
|
|
|
|
|
|
|
|
Result = OPI_Notion.CreateDatabase(Token, Parent, Title, Properties);
|
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 CreateDatabase --token "secret_9RsfMrRMqZwqp0Zl0B..." --page "5dd94c34fab04bff9..." --title "This base is from 1C" --props %props%
|
2024-06-05 10:19:46 +00:00
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
```json title="Result"
|
2024-10-02 09:14:30 +03:00
|
|
|
|
2024-06-05 10:19:46 +00:00
|
|
|
```
|