Class: ConversationsHelper

ConversationsHelper()

A helper type for conversation-related API endpoints.

Constructor

new ConversationsHelper()

Source:

Methods

(async) list(sort) → {Array.<Conversation>}

List a page of unread conversations.
Parameters:
Name Type Description
sort SortOptions | undefined An optional set of sort options.
Source:
Returns:
An array of raw data objects.
Type
Array.<Conversation>

(async) listAll(sort) → {Array.<Conversation>}

List all pages of unread conversations.
Parameters:
Name Type Description
sort SortOptions | undefined An optional set of sort options.
Source:
Returns:
An array of raw data objects.
Type
Array.<Conversation>

(async) listReplies(conversationId, sort) → {Array.<Reply>}

List a page of replies to an unread conversation.
Parameters:
Name Type Description
conversationId number The identifier of the unread conversation.
sort SortOptions | undefined An optional set of sort options.
Source:
Returns:
An array of raw data objects.
Type
Array.<Reply>

(async) listRepliesAll(conversationId, sort) → {Array.<Reply>}

List all pages of replies to an unread conversation.
Parameters:
Name Type Description
conversationId number The identifier of the unread conversation.
sort SortOptions | undefined An optional set of sort options.
Source:
Returns:
An array of raw data objects.
Type
Array.<Reply>

(async) listRepliesUntil(conversationId, shouldContinue, sort) → {Array.<Reply>}

List multiple pages of replies to an unread conversation until a condition is no longer met.
Parameters:
Name Type Description
conversationId number The identifier of the unread conversation.
shouldContinue function A function which determines if further pages are requested.
sort SortOptions | undefined An optional set of sort options.
Source:
Returns:
An array of raw data objects.
Type
Array.<Reply>

(async) listUntil(shouldContinue, sort) → {Array.<Conversation>}

List multiple pages of unread conversations until a condition is no longer met.
Parameters:
Name Type Description
shouldContinue function A function which determines if further pages are requested.
sort SortOptions | undefined An optional set of sort options.
Source:
Returns:
An array of raw data objects.
Type
Array.<Conversation>

(async) reply(conversationId, message) → {number}

Reply to an unread conversation
Parameters:
Name Type Description
conversationId number The identifier of the unread conversation.
message string The content of the new reply.
Source:
Returns:
The identifier of the newly-created conversation message.
Type
number

(async) start(title, message, recipientIds) → {number}

Start a new conversation.
Parameters:
Name Type Description
title string The title of the conversation.
message string The content of the first message in the conversation.
recipientIds Array.<number> An array of recipient identifiers.
Source:
Returns:
The newly-created conversation identifier.
Type
number