| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | How to use this document | |||||||||||||||||||||||||
2 | ||||||||||||||||||||||||||
3 | All of the work in this document is in the Query Editor | |||||||||||||||||||||||||
4 | 1. Go to the 'Data' tab | |||||||||||||||||||||||||
5 | 2. Select 'Queries and Connection' | 1 | ||||||||||||||||||||||||
6 | ||||||||||||||||||||||||||
7 | Limitations | |||||||||||||||||||||||||
8 | ||||||||||||||||||||||||||
9 | This document include the code to retrieve a JSON object from your notion databases. | |||||||||||||||||||||||||
10 | This document does not convert that JSON object into an easy to use format automatically | |||||||||||||||||||||||||
11 | ^ It is my hope that sharing this document on stack overflow will help to resolve that issue | |||||||||||||||||||||||||
12 | ||||||||||||||||||||||||||
13 | Key Functions Explained | |||||||||||||||||||||||||
14 | ||||||||||||||||||||||||||
15 | QueryDatabaseFromNotion | |||||||||||||||||||||||||
16 | Takes a 'Notion Database ID' and 'Secret API Key' and retrieves the notion database as JSON object. (Automatically does pagination.) | |||||||||||||||||||||||||
17 | To use this for your database: | |||||||||||||||||||||||||
18 | 1. Find your Notion Database ID. (Do a quick google if required. Hint, it is in the url) | |||||||||||||||||||||||||
19 | 2. Setup a secret API key with access to your database. (Do a quick google if required) | |||||||||||||||||||||||||
20 | ||||||||||||||||||||||||||
21 | Expand Properties Column | |||||||||||||||||||||||||
22 | Simply expands the properties column of the JSON object returned. (All user defined properties are under this JSON branch) | |||||||||||||||||||||||||
23 | ||||||||||||||||||||||||||
24 | Final Notes | |||||||||||||||||||||||||
25 | ||||||||||||||||||||||||||
26 | Never share your personal databaseId or secretAPIKey with others. This database and api key do not access personal information and so can be shared online for learning purposes. | |||||||||||||||||||||||||
27 | Still please be kind to others. | |||||||||||||||||||||||||
28 | ||||||||||||||||||||||||||
29 | ||||||||||||||||||||||||||
30 | ||||||||||||||||||||||||||
31 | ||||||||||||||||||||||||||
32 | ||||||||||||||||||||||||||
33 | ||||||||||||||||||||||||||
34 | ||||||||||||||||||||||||||
35 | ||||||||||||||||||||||||||
36 | ||||||||||||||||||||||||||
37 | ||||||||||||||||||||||||||
38 | ||||||||||||||||||||||||||
39 | ||||||||||||||||||||||||||
40 | ||||||||||||||||||||||||||
41 | ||||||||||||||||||||||||||
42 | ||||||||||||||||||||||||||
43 | ||||||||||||||||||||||||||
44 | ||||||||||||||||||||||||||
45 | ||||||||||||||||||||||||||
46 | ||||||||||||||||||||||||||
47 | ||||||||||||||||||||||||||
48 | ||||||||||||||||||||||||||
49 | ||||||||||||||||||||||||||
50 | ||||||||||||||||||||||||||
51 | ||||||||||||||||||||||||||
52 | ||||||||||||||||||||||||||
53 | ||||||||||||||||||||||||||
54 | ||||||||||||||||||||||||||
55 | ||||||||||||||||||||||||||
56 | ||||||||||||||||||||||||||
57 | ||||||||||||||||||||||||||
58 | ||||||||||||||||||||||||||
59 | ||||||||||||||||||||||||||
60 | ||||||||||||||||||||||||||
61 | ||||||||||||||||||||||||||
62 | ||||||||||||||||||||||||||
63 | ||||||||||||||||||||||||||
64 | ||||||||||||||||||||||||||
65 | ||||||||||||||||||||||||||
66 | ||||||||||||||||||||||||||
67 | ||||||||||||||||||||||||||
68 | ||||||||||||||||||||||||||
69 | ||||||||||||||||||||||||||
70 | ||||||||||||||||||||||||||
71 | ||||||||||||||||||||||||||
72 | ||||||||||||||||||||||||||
73 | ||||||||||||||||||||||||||
74 | ||||||||||||||||||||||||||
75 | ||||||||||||||||||||||||||
76 | ||||||||||||||||||||||||||
77 | ||||||||||||||||||||||||||
78 | ||||||||||||||||||||||||||
79 | ||||||||||||||||||||||||||
80 | ||||||||||||||||||||||||||
81 | ||||||||||||||||||||||||||
82 | ||||||||||||||||||||||||||
83 | ||||||||||||||||||||||||||
84 | ||||||||||||||||||||||||||
85 | ||||||||||||||||||||||||||
86 | ||||||||||||||||||||||||||
87 | ||||||||||||||||||||||||||
88 | ||||||||||||||||||||||||||
89 | ||||||||||||||||||||||||||
90 | ||||||||||||||||||||||||||
91 | ||||||||||||||||||||||||||
92 | ||||||||||||||||||||||||||
93 | ||||||||||||||||||||||||||
94 | ||||||||||||||||||||||||||
95 | ||||||||||||||||||||||||||
96 | ||||||||||||||||||||||||||
97 | ||||||||||||||||||||||||||
98 | ||||||||||||||||||||||||||
99 | ||||||||||||||||||||||||||
100 |