MillionSend.ApiKeys (MillionSend v0.6.0)

Copy Markdown View Source

API keys. Input maps are sent as given: name, permission (:full_access, the default, or :sending_access) and domain_id (restrict a sending key to one domain).

{:ok, key} = MillionSend.ApiKeys.create(%{name: "ci", permission: :sending_access})
key.token

Summary

Functions

POST /api-keys — the response carries the one-time token.

GET /api-keys — accepts limit:, after:, before:.

Functions

create(client \\ MillionSend.client(), params)

@spec create(MillionSend.Client.t(), map()) ::
  {:ok, MillionSend.ApiKeys.ApiKey.t()} | {:error, MillionSend.Error.t()}

POST /api-keys — the response carries the one-time token.

list()

GET /api-keys — accepts limit:, after:, before:.

list(client)

@spec list(MillionSend.Client.t() | keyword()) ::
  {:ok, MillionSend.List.t()} | {:error, MillionSend.Error.t()}

list(client, opts)

@spec list(
  MillionSend.Client.t(),
  keyword()
) :: {:ok, MillionSend.List.t()} | {:error, MillionSend.Error.t()}

remove(client \\ MillionSend.client(), id)

@spec remove(MillionSend.Client.t(), String.t()) ::
  {:ok, MillionSend.ApiKeys.ApiKey.t()} | {:error, MillionSend.Error.t()}

DELETE /api-keys/:id