Attio.Client (Attio v0.2.0)

Copy Markdown View Source

HTTP client for the Attio API.

Build a client once with new/1 and pass it to resource functions:

client = Attio.Client.new(api_key: System.fetch_env!("ATTIO_API_KEY"))
{:ok, response} = Attio.Records.list(client, "people")

Options for new/1

  • :api_key - Required. Your Attio API key (used as a Bearer token).
  • :base_url - Optional. Defaults to https://api.attio.com.

Any additional keyword options are forwarded to Req.new/1, which allows test-time injection of a plug adapter:

client = Attio.Client.new(api_key: "test", plug: {Req.Test, __MODULE__})

Summary

Functions

Creates a new client.

Types

t()

@type t() :: %Attio.Client{req: Req.Request.t()}

Functions

new(opts)

@spec new(keyword()) :: t()

Creates a new client.

Raises KeyError if :api_key is not provided.