ConvergerClient.TenantAPI (converger_client v0.1.1)

Copy Markdown View Source

The tenant API under /api/v1, authenticated with the tenant API key (x-api-key). For bots, CRMs and other backends.

Summary

Functions

A conversation with its participant.

A conversation's activities after a watermark, oldest first. Options: :watermark (the integer seq or a legacy opaque string, sent as is), :limit.

The tenant's conversations, newest first.

Posts an activity (for example a bot reply with sender: "bot").

Types

result(t)

@type result(t) :: {:ok, t} | {:error, ConvergerClient.Error.t() | Exception.t()}

Functions

close_conversation(client, conversation_id)

@spec close_conversation(ConvergerClient.t(), String.t()) ::
  result(ConvergerClient.Conversation.t())

Closes a conversation.

get_conversation(client, conversation_id)

@spec get_conversation(ConvergerClient.t(), String.t()) ::
  result(ConvergerClient.Conversation.t())

A conversation with its participant.

list_activities(client, conversation_id, opts \\ [])

@spec list_activities(ConvergerClient.t(), String.t(), keyword()) ::
  result(ConvergerClient.ActivityPage.t())

A conversation's activities after a watermark, oldest first. Options: :watermark (the integer seq or a legacy opaque string, sent as is), :limit.

list_conversations(client, opts \\ [])

@spec list_conversations(ConvergerClient.t(), keyword()) ::
  result(ConvergerClient.Page.t())

The tenant's conversations, newest first.

Options: :limit, :cursor, :status, :channel_id, :external_id.

post_activity(client, conversation_id, attrs, opts \\ [])

@spec post_activity(ConvergerClient.t(), String.t(), map() | keyword(), keyword()) ::
  result(ConvergerClient.Activity.t())

Posts an activity (for example a bot reply with sender: "bot").

attrs (map or keyword): :type, :sender, :text, :attachments, :metadata, :reply_to_id. Options: :idempotency_key.

reopen_conversation(client, conversation_id)

@spec reopen_conversation(ConvergerClient.t(), String.t()) ::
  result(ConvergerClient.Conversation.t())

Reopens a conversation.