KapsoEx.Platform.InboxEmbeds (kapso_ex v0.1.0)

Copy Markdown View Source

Access links to embed the Kapso inbox in your own application through an iframe.

The raw token and embed URL are only returned by create/2; store them then.

Summary

Functions

Creates an inbox embed.

Gets an inbox embed (without its token or URL).

Lists inbox embeds, most recent first.

Revokes the embed token immediately.

Updates an inbox embed. The scope cannot be changed.

Types

result()

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

Functions

create(client, attrs)

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

Creates an inbox embed.

Attributes: scope_type (required: "project", "customer" or "phone_number"), scope_id, name, assigned_user_id, allowed_origins, default_mode ("system", "light", "dark"), language ("en", "es"), expires_at.

InboxEmbeds.create(client, scope_type: "customer", scope_id: customer_id,
  allowed_origins: ["https://app.example.com"], language: "es")

get(client, inbox_embed_id)

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

Gets an inbox embed (without its token or URL).

list(client, params \\ [])

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

Lists inbox embeds, most recent first.

Params: status, scope_type, scope_id, assigned_user_id, page, per_page.

revoke(client, inbox_embed_id)

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

Revokes the embed token immediately.

update(client, inbox_embed_id, attrs)

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

Updates an inbox embed. The scope cannot be changed.