Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) AddComment(pageID, text string, mentionUserIDs []string) ([]byte, error)
- func (c *Client) Delete(path string) ([]byte, error)
- func (c *Client) DeleteComment(commentID string) ([]byte, error)
- func (c *Client) Get(path string) ([]byte, error)
- func (c *Client) GetBlock(blockID string) (map[string]interface{}, error)
- func (c *Client) GetBlockChildren(blockID string, pageSize int, startCursor string) (map[string]interface{}, error)
- func (c *Client) GetDatabase(dbID string) (map[string]interface{}, error)
- func (c *Client) GetMe() (map[string]interface{}, error)
- func (c *Client) GetPage(pageID string) (map[string]interface{}, error)
- func (c *Client) GetUser(userID string) (map[string]interface{}, error)
- func (c *Client) GetUsers(pageSize int, startCursor string) (map[string]interface{}, error)
- func (c *Client) ListComments(blockID string, pageSize int, startCursor string) (map[string]interface{}, error)
- func (c *Client) Patch(path string, body interface{}) ([]byte, error)
- func (c *Client) Post(path string, body interface{}) ([]byte, error)
- func (c *Client) QueryDatabase(dbID string, body map[string]interface{}) (map[string]interface{}, error)
- func (c *Client) Search(query string, filter string, pageSize int, startCursor string) (map[string]interface{}, error)
- func (c *Client) SetDebug(debug bool)
- func (c *Client) UpdateComment(commentID, text string, mentionUserIDs []string) ([]byte, error)
- func (c *Client) UploadFileContent(uploadID, fileName, contentType string, fileBytes []byte) ([]byte, error)
Constants ¶
const ( BaseURL = "https://api.notion.com" NotionVersion = "2022-06-28" DefaultTimeout = 30 * time.Second UploadTimeout = 5 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewWithBaseURL ¶ added in v0.3.1
NewWithBaseURL creates a client pointing at a custom API base (for testing).
func (*Client) AddComment ¶
AddComment adds a comment to a page.
func (*Client) DeleteComment ¶ added in v0.7.0
DeleteComment removes a comment by id. Wraps DELETE /v1/comments/:id (added in Notion API 2025). When the target is the anchor comment of a discussion, Notion removes the whole thread; otherwise it removes just that one reply.
func (*Client) GetBlockChildren ¶
func (c *Client) GetBlockChildren(blockID string, pageSize int, startCursor string) (map[string]interface{}, error)
GetBlockChildren retrieves children of a block.
func (*Client) GetDatabase ¶
GetDatabase retrieves a database by ID.
func (*Client) ListComments ¶
func (c *Client) ListComments(blockID string, pageSize int, startCursor string) (map[string]interface{}, error)
ListComments lists comments on a block/page.
func (*Client) QueryDatabase ¶
func (c *Client) QueryDatabase(dbID string, body map[string]interface{}) (map[string]interface{}, error)
QueryDatabase queries a database with filters and sorts.
func (*Client) Search ¶
func (c *Client) Search(query string, filter string, pageSize int, startCursor string) (map[string]interface{}, error)
Search performs a search across the workspace.
func (*Client) UpdateComment ¶ added in v0.7.0
UpdateComment edits the rich_text body of an existing comment. Wraps PATCH /v1/comments/:id (added in Notion API 2025).