Skip to content

Commit 50f1f89

Browse files
author
Erik Guzman
committed
Add doc to retrieve page function
1 parent e1ff40c commit 50f1f89

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"testExplorer.useNativeTesting": true
3+
}

lib/thin_notion_api/pages.ex

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,48 @@
11
defmodule ThinNotionApi.Pages do
22
import ThinNotionApi.Base
33

4+
@doc """
5+
Retrieves a Page object using the ID specified.
6+
7+
Responses contains page properties, not page content. To fetch page content, use the retrieve block children endpoint.
8+
9+
## Examples:
10+
iex> ThinNotionApi.Pages.retrieve_page("9b4a624d5a18482ab2187e54166edda7")
11+
{:ok,
12+
%{
13+
"archived" => false,
14+
"created_time" => "2021-06-11T20:34:00.000Z",
15+
"id" => "9b4a624d-5a18-482a-b218-7e54166edda7",
16+
"last_edited_time" => "2021-07-30T21:03:00.000Z",
17+
"object" => "page",
18+
"parent" => %{"type" => "workspace", "workspace" => true},
19+
"properties" => %{
20+
"title" => %{
21+
"id" => "title",
22+
"title" => [
23+
%{
24+
"annotations" => %{
25+
"bold" => false,
26+
"code" => false,
27+
"color" => "default",
28+
"italic" => false,
29+
"strikethrough" => false,
30+
"underline" => false
31+
},
32+
"href" => nil,
33+
"plain_text" => "Thin Notion Test Workspace",
34+
"text" => %{"content" => "Thin Notion Test Workspace", "link" => nil},
35+
"type" => "text"
36+
}
37+
],
38+
"type" => "title"
39+
}
40+
},
41+
"url" => "https://www.notion.so/Thin-Notion-Test-Workspace-9b4a624d5a18482ab2187e54166edda7"
42+
}
43+
}
44+
"""
45+
@spec retrieve_page(String.t()) :: map()
446
def retrieve_page(page_id) do
547
get("pages/#{page_id}")
648
end

0 commit comments

Comments
 (0)