# `Twilio`

Elixir SDK for Twilio - Api (API version 1.0.0).

This is the public Twilio REST API.

## Configuration

The API key is read from `TWILIO_ACCOUNT_SID` and `TWILIO_AUTH_TOKEN`, or set it in your config:

    config :twilio, api_key: {"user", "password"}, max_retries: 3, timeout: 60_000

`:account_sid` fills `{AccountSid}` in every path, read from `TWILIO_ACCOUNT_SID` unless set: `config :twilio, account_sid: "..."`, or `account_sid: "..."` on a single call.

Any setting can also be given to a single call, as the last argument:

    Twilio.SomeResource.some_call(params, timeout: 5_000)

Generated by [Infusion](https://github.com/mandar1045/infusion).

# `config`

```elixir
@spec config(keyword()) :: Infusion.Runtime.Config.t()
```

The settings for a call: the defaults, then `config :twilio, ...`, then
`opts`. See `Infusion.Runtime.Config` for every setting.

# `request`

```elixir
@spec request(atom(), String.t(), map() | keyword(), keyword()) ::
  {:ok, term()} | {:error, Infusion.Runtime.Error.t()}
```

Calls an endpoint this SDK has no function for:

    Twilio.request(:get, "/some/path", %{"limit" => 10})

`params` go into the query for GET and DELETE, into a JSON body otherwise.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
