Skip to main content

SearchClient

Client for interacting with Comms search endpoints.

Extends

  • BaseClient

Constructors

Constructor

new SearchClient(config: ClientConfig): SearchClient;

Parameters

ParameterType
configClientConfig

Returns

SearchClient

Inherited from

BaseClient.constructor

Properties

PropertyModifierType
apiTokenreadonlystring
baseUrl?readonlystring
customFetch?readonlyCustomFetch
defaultVersionreadonly"v1"

Methods

getBaseUri()

protected getBaseUri(): string;

Returns the base URI for an API request, with a guaranteed trailing slash so relative paths resolve cleanly through URL.

Returns

string

Inherited from

BaseClient.getBaseUri

getLinkBaseUrl()

protected getLinkBaseUrl(): string | undefined;

Base URL for entity web links, or undefined to use getFullCommsURL's default web app. Trailing-slash normalization happens in getFullCommsURL, so the configured value is returned verbatim.

Returns

string | undefined

Inherited from

BaseClient.getLinkBaseUrl

search(args: SearchArgs): Promise<SearchResponse>;

Searches across all threads and conversations in a workspace.

Parameters

ParameterTypeDescription
argsSearchArgsThe arguments for searching.

Returns

Promise<SearchResponse>

Search results with pagination.

Example

const results = await api.search.search({
query: 'important meeting',
workspaceId: 123,
})

searchConversation()

searchConversation(args: SearchConversationArgs): Promise<SearchConversationResponse>;

Searches within messages of a specific conversation.

Parameters

ParameterTypeDescription
argsSearchConversationArgsThe arguments for searching within a conversation.

Returns

Promise<SearchConversationResponse>

Message IDs that match the search query.

Example

const results = await api.search.searchConversation({
query: 'budget',
conversationId: '7YpL3oZ4kZ9vP7Q1tR2sX42',
})

searchThread()

searchThread(args: SearchThreadArgs): Promise<SearchThreadResponse>;

Searches within comments of a specific thread.

Parameters

ParameterTypeDescription
argsSearchThreadArgsThe arguments for searching within a thread.

Returns

Promise<SearchThreadResponse>

Comment IDs that match the search query.

Example

const results = await api.search.searchThread({
query: 'deadline',
threadId: '7YpL3oZ4kZ9vP7Q1tR2sX3z',
})