client

package
v0.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaseURL        = "https://api.notion.com"
	NotionVersion  = "2022-06-28"
	DefaultTimeout = 30 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(token string) *Client

func (*Client) AddComment

func (c *Client) AddComment(pageID, text string) ([]byte, error)

AddComment adds a plain text comment to a page (no mentions).

func (*Client) AddCommentRichText added in v0.6.0

func (c *Client) AddCommentRichText(pageID string, richText []interface{}) ([]byte, error)

AddCommentRichText adds a comment with a rich_text array (supports mentions).

func (*Client) Delete

func (c *Client) Delete(path string) ([]byte, error)

func (*Client) Get

func (c *Client) Get(path string) ([]byte, error)

func (*Client) GetBlock

func (c *Client) GetBlock(blockID string) (map[string]interface{}, error)

GetBlock retrieves a single block by ID.

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

func (c *Client) GetDatabase(dbID string) (map[string]interface{}, error)

GetDatabase retrieves a database by ID.

func (*Client) GetMe

func (c *Client) GetMe() (map[string]interface{}, error)

GetMe returns the bot user info for the current token.

func (*Client) GetPage

func (c *Client) GetPage(pageID string) (map[string]interface{}, error)

GetPage retrieves a page by ID.

func (*Client) GetUser

func (c *Client) GetUser(userID string) (map[string]interface{}, error)

GetUser retrieves a user by ID.

func (*Client) GetUsers

func (c *Client) GetUsers(pageSize int, startCursor string) (map[string]interface{}, error)

GetUsers lists all users.

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) Patch

func (c *Client) Patch(path string, body interface{}) ([]byte, error)

func (*Client) Post

func (c *Client) Post(path string, body interface{}) ([]byte, error)

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) SetDebug

func (c *Client) SetDebug(debug bool)

func (*Client) UploadFileContent

func (c *Client) UploadFileContent(uploadID, fileName, contentType string, fileBytes []byte) error

UploadFileContent sends file content to an existing file upload via multipart form.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL