NotionElixir (notion_elixir v0.1.2) View Source

API Wrapper for Notion API

Link to this section Summary

Functions

Build a client for re-use over requests

Make a get request against the API

Make a get request against the API using the supplied client

Make a patch request against the API

Make a patch request against the API using the supplied client

Make a post request against the API

Make a post request against the API using the supplied client

Make a post request against the API, and retrieve all paginated results

Make a post request against the API, and retrieve all paginated results

Link to this section Types

Specs

options() :: Keyword.t()

Specs

response() ::
  {:ok, NotionElixir.Response.t()}
  | {:ok, NotionElixir.ListResponse.t()}
  | {:error, any()}

Link to this section Functions

Link to this function

build_client(opts \\ [])

View Source

Specs

build_client(opts :: options()) :: Tesla.Client.t()

Build a client for re-use over requests

Options

  • :api_key - API key to use with the request.
  • :api_version - Version of the notion API
  • :base_url - API base url, defaults to "https://api.notion.com/v1"
Link to this function

get(request_path, opts \\ [])

View Source

Specs

get(request_path :: String.t(), opts :: options()) :: response()

Make a get request against the API

Options

  • :api_key - API key to use with the request.
  • :api_version - Version of the notion API
  • :base_url - API base url, defaults to "https://api.notion.com/v1"
Link to this function

get(client, request_path, opts)

View Source

Specs

get(client :: Tesla.Client.t(), request_path :: String.t(), opts :: options()) ::
  response()

Make a get request against the API using the supplied client

Link to this function

patch(request_path, data, opts \\ [])

View Source

Specs

patch(request_path :: String.t(), data :: map(), opts :: options()) ::
  response()

Make a patch request against the API

Options

  • :api_key - API key to use with the request.
  • :api_version - Version of the notion API
  • :base_url - API base url, defaults to "https://api.notion.com/v1"
Link to this function

patch(client, request_path, data, opts)

View Source

Specs

patch(
  client :: Tesla.Client.t(),
  request_path :: String.t(),
  data :: map(),
  opts :: options()
) :: response()

Make a patch request against the API using the supplied client

Options

  • :api_key - API key to use with the request.
  • :api_version - Version of the notion API
  • :base_url - API base url, defaults to "https://api.notion.com/v1"
Link to this function

post(request_path, data, opts \\ [])

View Source

Specs

post(request_path :: String.t(), data :: map(), opts :: options()) :: response()

Make a post request against the API

Options

  • :api_key - API key to use with the request.
  • :api_version - Version of the notion API
  • :base_url - API base url, defaults to "https://api.notion.com/v1"
Link to this function

post(client, request_path, data, opts)

View Source

Specs

post(
  client :: Tesla.Client.t(),
  request_path :: String.t(),
  data :: map(),
  opts :: options()
) :: response()

Make a post request against the API using the supplied client

Link to this function

post_all(request_path, data, opts \\ [])

View Source

Specs

post_all(request_path :: String.t(), data :: map(), opts :: options()) ::
  response()
post_all(request_path :: String.t(), data :: map(), opts :: options()) ::
  {:ok, NotionElixir.ListResponse.t()} | {:error, any()}

Make a post request against the API, and retrieve all paginated results

Options

  • :api_key - API key to use with the request.
  • :api_version - Version of the notion API
  • :base_url - API base url, defaults to "https://api.notion.com/v1"
Link to this function

post_all(client, request_path, data, opts)

View Source

Make a post request against the API, and retrieve all paginated results