KapsoEx.Platform.SetupLinks (kapso_ex v0.1.0)

Copy Markdown View Source

Setup links are hosted onboarding pages where a customer connects their WhatsApp number. See Create and configure.

Summary

Functions

Creates a setup link. The response data.url is the page to send to the customer.

Lists a customer's setup links, most recent first.

Updates a setup link. Besides the create/3 attributes, accepts expires_at and status (for example "revoked").

Types

result()

@type result() :: {:ok, map()} | {:error, KapsoEx.Error.t()}

Functions

create(client, customer_id, attrs \\ %{})

@spec create(KapsoEx.Client.t(), String.t(), map() | keyword()) :: result()

Creates a setup link. The response data.url is the page to send to the customer.

Attributes include success_redirect_url, failure_redirect_url, allowed_origins, allowed_connection_types, provision_phone_number, phone_number_area_code, phone_number_country_isos, meta_billing_mode, theme_config, reconnect_phone_number and language.

SetupLinks.create(client, customer_id, %{
  success_redirect_url: "https://app.example.com/whatsapp/connected",
  language: "es"
})

list(client, customer_id, params \\ [])

@spec list(KapsoEx.Client.t(), String.t(), map() | keyword()) :: result()

Lists a customer's setup links, most recent first.

Params: status, created_after, created_before, page, per_page.

update(client, customer_id, setup_link_id, attrs)

@spec update(KapsoEx.Client.t(), String.t(), String.t(), map() | keyword()) ::
  result()

Updates a setup link. Besides the create/3 attributes, accepts expires_at and status (for example "revoked").