The client API under /api/v1/converger, authenticated with converger
tokens (Authorization: Bearer). Your backend mints tokens with the
channel secret (generate_token/2) and hands conversation-bound tokens to
end users, or uses them itself (for example with ConvergerClient.Socket).
Summary
Functions
Closes a conversation.
Starts a conversation; the returned token is bound to it.
Exchanges the channel secret for a converger token.
A new conversation-bound token for an existing conversation. Options: :watermark.
Activities after a watermark, oldest first. Options: :watermark (the
integer seq or a legacy opaque string, sent as is), :limit.
Posts an activity as the end user.
Exchanges a valid token for a fresh one.
Reopens a conversation.
Types
@type result(t) :: {:ok, t} | {:error, ConvergerClient.Error.t() | Exception.t()}
Functions
@spec close_conversation(ConvergerClient.t(), String.t(), String.t()) :: result(ConvergerClient.ConversationStatus.t())
Closes a conversation.
@spec create_conversation(ConvergerClient.t(), String.t()) :: result(ConvergerClient.ConversationToken.t())
Starts a conversation; the returned token is bound to it.
@spec generate_token(ConvergerClient.t(), keyword()) :: result(ConvergerClient.TokenResponse.t())
Exchanges the channel secret for a converger token.
Options: :user_id, :scope (only "channel", for agent sockets).
@spec get_conversation(ConvergerClient.t(), String.t(), String.t(), keyword()) :: result(ConvergerClient.ConversationToken.t())
A new conversation-bound token for an existing conversation. Options: :watermark.
@spec list_activities(ConvergerClient.t(), String.t(), String.t(), keyword()) :: result(ConvergerClient.ClientActivityPage.t())
Activities after a watermark, oldest first. Options: :watermark (the
integer seq or a legacy opaque string, sent as is), :limit.
@spec post_activity( ConvergerClient.t(), String.t(), String.t(), map() | keyword(), keyword() ) :: result(ConvergerClient.ResourceResponse.t())
Posts an activity as the end user.
attrs (map or keyword): :type, :text, :from_id, :attachments,
:reply_to_id, :channel_data. Options: :idempotency_key.
@spec refresh_token(ConvergerClient.t(), String.t()) :: result(ConvergerClient.TokenResponse.t())
Exchanges a valid token for a fresh one.
@spec reopen_conversation(ConvergerClient.t(), String.t(), String.t()) :: result(ConvergerClient.ConversationStatus.t())
Reopens a conversation.