SearchClient
Client for interacting with Comms search endpoints.
Extends
BaseClient
Constructors
Constructor
new SearchClient(config: ClientConfig): SearchClient;
Parameters
| Parameter | Type |
|---|---|
config | ClientConfig |
Returns
SearchClient
Inherited from
BaseClient.constructor
Properties
| Property | Modifier | Type |
|---|---|---|
apiToken | readonly | string |
baseUrl? | readonly | string |
customFetch? | readonly | CustomFetch |
defaultVersion | readonly | "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()
search(args: SearchArgs): Promise<SearchResponse>;
Searches across all threads and conversations in a workspace.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | SearchArgs | The 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
| Parameter | Type | Description |
|---|---|---|
args | SearchConversationArgs | The 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
| Parameter | Type | Description |
|---|---|---|
args | SearchThreadArgs | The 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',
})