Skip to main content

ReactionsClient

Client for interacting with Comms reaction endpoints.

Extends​

  • BaseClient

Constructors​

Constructor​

new ReactionsClient(config: ClientConfig): ReactionsClient;

Parameters​

ParameterType
configClientConfig

Returns​

ReactionsClient

Inherited from​

BaseClient.constructor

Properties​

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

Methods​

add()​

add(args: AddReactionArgs): Promise<void>;

Adds an emoji reaction to a thread, comment, or conversation message.

Parameters​

ParameterTypeDescription
argsAddReactionArgsThe arguments for adding a reaction.

Returns​

Promise<void>

Example​

await api.reactions.add({ threadId: '7YpL3oZ4kZ9vP7Q1tR2sX3z', reaction: '👍' })

get()​

get(args: GetReactionsArgs): Promise<ReactionObject>;

Gets reactions for a thread, comment, or conversation message.

Returns an object with emoji reactions as keys and arrays of user IDs as values, or null if no reactions.

Parameters​

ParameterTypeDescription
argsGetReactionsArgsThe arguments for getting reactions.

Returns​

Promise<ReactionObject>

A reaction object with emoji reactions as keys and arrays of user IDs as values, or null if no reactions.

Example​

const reactions = await api.reactions.get({ threadId: '7YpL3oZ4kZ9vP7Q1tR2sX3z' })
// Returns: { "👍": [101, 202, 303], "❤️": [101, 202] }

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

remove()​

remove(args: RemoveReactionArgs): Promise<void>;

Removes an emoji reaction from a thread, comment, or conversation message.

Parameters​

ParameterTypeDescription
argsRemoveReactionArgsThe arguments for removing a reaction.

Returns​

Promise<void>

Example​

await api.reactions.remove({ threadId: '7YpL3oZ4kZ9vP7Q1tR2sX3z', reaction: '👍' })