Comments, mentions, and direct messages on connected accounts.
Every function needs the inbox scope. Lists answer a FoPost.Page whose
meta.current_page, meta.per_page, and meta.total are set.
{:ok, page} = FoPost.Inbox.list(client, workspace_id: id, state: "unread")
{:ok, result} = FoPost.Inbox.reply(client, item.id, text: "Thanks!")
Summary
Functions
Every active account, flagged with whether comments and DMs can be read for it.
Same as accounts/2, but raises FoPost.Error.
Replies an automation or the agent drafted that a person still has to send.
Same as approvals/2, but raises FoPost.Error.
Sends a drafted reply, or :text in its place. id is the approval's integer id.
Same as approve_reply/3, but raises FoPost.Error.
One page of direct-message threads, latest first.
Same as conversations/2, but raises FoPost.Error.
Deletes a comment on the platform.
Same as delete/2, but raises FoPost.Error.
Hides a comment on the platform.
Same as hide/2, but raises FoPost.Error.
One page of items, newest first.
Same as list/2, but raises FoPost.Error.
Marks a whole comment thread or DM thread read; answers how many items changed.
Same as mark_thread_read/2, but raises FoPost.Error.
Inbox support per platform.
Same as platforms/1, but raises FoPost.Error.
Polls every inbox-capable account in the workspace now. Required: :workspace_id.
Same as refresh/2, but raises FoPost.Error.
Discards a drafted reply. id is the approval's integer id.
Same as reject_reply/2, but raises FoPost.Error.
Sends a reply on the platform as the connected account. Required: :text.
Same as reply/3, but raises FoPost.Error.
One page of threads: one row per post with comments, or with mentions when :kind is
"mentions".
Same as threads/2, but raises FoPost.Error.
Shows a hidden comment again.
Same as unhide/2, but raises FoPost.Error.
How many items are unread, optionally narrowed with :workspace_id.
Same as unread_count/2, but raises FoPost.Error.
Sets an item's state. Required: :state (unread, read, resolved, snoozed);
:snoozed_until goes with "snoozed" and accepts a DateTime or an ISO 8601 string.
Same as update/3, but raises FoPost.Error.
Functions
@spec accounts( FoPost.Client.t(), keyword() ) :: {:ok, [FoPost.InboxAccount.t()]} | {:error, FoPost.Error.t()}
Every active account, flagged with whether comments and DMs can be read for it.
Same as accounts/2, but raises FoPost.Error.
@spec approvals( FoPost.Client.t(), keyword() ) :: {:ok, [FoPost.InboxApproval.t()]} | {:error, FoPost.Error.t()}
Replies an automation or the agent drafted that a person still has to send.
Same as approvals/2, but raises FoPost.Error.
@spec approve_reply(FoPost.Client.t(), integer(), keyword()) :: {:ok, FoPost.InboxDecision.t()} | {:error, FoPost.Error.t()}
Sends a drafted reply, or :text in its place. id is the approval's integer id.
Same as approve_reply/3, but raises FoPost.Error.
@spec conversations( FoPost.Client.t(), keyword() ) :: {:ok, FoPost.Page.t()} | {:error, FoPost.Error.t()}
One page of direct-message threads, latest first.
Filters: :workspace_id, :platform, :account_id, :state, :q, :sort. Paging:
:page, :per_page.
Same as conversations/2, but raises FoPost.Error.
@spec delete(FoPost.Client.t(), String.t()) :: {:ok, FoPost.Message.t()} | {:error, FoPost.Error.t()}
Deletes a comment on the platform.
Same as delete/2, but raises FoPost.Error.
@spec hide(FoPost.Client.t(), String.t()) :: {:ok, FoPost.InboxItem.t()} | {:error, FoPost.Error.t()}
Hides a comment on the platform.
Same as hide/2, but raises FoPost.Error.
@spec list( FoPost.Client.t(), keyword() ) :: {:ok, FoPost.Page.t()} | {:error, FoPost.Error.t()}
One page of items, newest first.
Filters: :workspace_id, :type (comment, mention, dm), :state (unread,
read, resolved, snoozed), :platform, :account_id, :post_id,
:post_external_id, :conversation_id, :direction (inbound, outbound), :q,
:sort (newest, oldest, unanswered). Paging: :page, :per_page.
Same as list/2, but raises FoPost.Error.
@spec mark_thread_read( FoPost.Client.t(), keyword() ) :: {:ok, integer()} | {:error, FoPost.Error.t()}
Marks a whole comment thread or DM thread read; answers how many items changed.
Required: :workspace_id, :account_id, plus :post_external_id for a comment thread
or :conversation_id for a DM thread.
Same as mark_thread_read/2, but raises FoPost.Error.
@spec platforms(FoPost.Client.t()) :: {:ok, [FoPost.InboxPlatform.t()]} | {:error, FoPost.Error.t()}
Inbox support per platform.
Same as platforms/1, but raises FoPost.Error.
@spec refresh( FoPost.Client.t(), keyword() ) :: {:ok, FoPost.InboxRefreshResult.t()} | {:error, FoPost.Error.t()}
Polls every inbox-capable account in the workspace now. Required: :workspace_id.
Same as refresh/2, but raises FoPost.Error.
@spec reject_reply(FoPost.Client.t(), integer()) :: {:ok, FoPost.InboxDecision.t()} | {:error, FoPost.Error.t()}
Discards a drafted reply. id is the approval's integer id.
Same as reject_reply/2, but raises FoPost.Error.
@spec reply(FoPost.Client.t(), String.t(), keyword()) :: {:ok, FoPost.InboxReplyResult.t()} | {:error, FoPost.Error.t()}
Sends a reply on the platform as the connected account. Required: :text.
Same as reply/3, but raises FoPost.Error.
@spec threads( FoPost.Client.t(), keyword() ) :: {:ok, FoPost.Page.t()} | {:error, FoPost.Error.t()}
One page of threads: one row per post with comments, or with mentions when :kind is
"mentions".
Filters: :workspace_id, :kind (comments, mentions), :platform, :account_id,
:state, :q, :sort. Paging: :page, :per_page.
Same as threads/2, but raises FoPost.Error.
@spec unhide(FoPost.Client.t(), String.t()) :: {:ok, FoPost.InboxItem.t()} | {:error, FoPost.Error.t()}
Shows a hidden comment again.
Same as unhide/2, but raises FoPost.Error.
@spec unread_count( FoPost.Client.t(), keyword() ) :: {:ok, integer()} | {:error, FoPost.Error.t()}
How many items are unread, optionally narrowed with :workspace_id.
Same as unread_count/2, but raises FoPost.Error.
@spec update(FoPost.Client.t(), String.t(), keyword()) :: {:ok, FoPost.InboxItem.t()} | {:error, FoPost.Error.t()}
Sets an item's state. Required: :state (unread, read, resolved, snoozed);
:snoozed_until goes with "snoozed" and accepts a DateTime or an ISO 8601 string.
Same as update/3, but raises FoPost.Error.