KapsoEx.Platform.PhoneNumbers (kapso_ex v0.1.0)

Copy Markdown View Source

WhatsApp numbers connected to your Kapso project.

For Meta's view of a number (quality rating, PIN, ...) see KapsoEx.WhatsApp.PhoneNumbers.

Summary

Functions

Connects a number you configured in Meta to a customer, using Meta credentials.

Removes a phone number from the project.

Gets a phone number.

Checks the number's health through Meta's APIs and Kapso services. Returns %{"status" => "healthy" | "degraded" | "unhealthy" | "error", "checks" => ...}.

Lists phone numbers, most recent first.

Updates a phone number. Attributes as in connect/3.

Types

result()

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

Functions

connect(client, customer_id, attrs)

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

Connects a number you configured in Meta to a customer, using Meta credentials.

Attributes: name, phone_number_id, business_account_id, access_token (required), kind ("production" or "sandbox"), webhook_verify_token, webhook_destination_url, inbound_processing_enabled, calls_enabled.

delete(client, phone_number_id)

@spec delete(KapsoEx.Client.t(), String.t()) :: result()

Removes a phone number from the project.

get(client, phone_number_id)

@spec get(KapsoEx.Client.t(), String.t()) :: result()

Gets a phone number.

health(client, phone_number_id)

@spec health(KapsoEx.Client.t(), String.t()) :: result()

Checks the number's health through Meta's APIs and Kapso services. Returns %{"status" => "healthy" | "degraded" | "unhealthy" | "error", "checks" => ...}.

list(client, params \\ [])

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

Lists phone numbers, most recent first.

Params: phone_number_id, business_account_id, customer_id, messaging_enabled, name_contains, created_after, created_before, page, per_page.

update(client, phone_number_id, attrs)

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

Updates a phone number. Attributes as in connect/3.