Skip to main content

InsightApiClient

Contains all the endpoints needed to manage insights.

Constructors

new InsightApiClient()

new InsightApiClient(): InsightApiClient

Returns

InsightApiClient

Methods

getBestContributionInsight()

static getBestContributionInsight(params?, config?): Promise <SCPaginatedResponse<SCContributionInsightType>>

This endpoint retrieves the best contribution insights list.

Parameters

ParameterTypeDescription
params?InsightContributionParams
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCContributionInsightType>>

Source

services/insight/index.ts:36


getBestEmbedInsight()

static getBestEmbedInsight(params?, config?): Promise <SCPaginatedResponse<SCEmbedInsightType>>

This endpoint retrieves the best embed insights list. The operations of this endpoint is quite complex and returns different result structures based on the parameters passed. For example, pagination (and therefore the use of the offset parameter) is guaranteed only if the metadata and group_by parameter are not passed. If you are passing metadata you MUST pass also group_by. If you pass group_by the result will be not paginated and will contain only user defined custom embeds (not among these: 'sc_link', 'sc_shared_object').

Parameters

ParameterTypeDescription
params?InsightEmbedParams
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCEmbedInsightType>>

Source

services/insight/index.ts:53


getBestUsersInsight()

static getBestUsersInsight(params?, config?): Promise <SCPaginatedResponse<SCUsersInsightType>>

This endpoint retrieves the best users insights list.

Parameters

ParameterTypeDescription
params?InsightUserParams
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCUsersInsightType>>

Source

services/insight/index.ts:63


getContributionsInsightCounters()

static getContributionsInsightCounters(id, config?): Promise<SCContributionInsightCountersType>

This endpoint retrieves a specific contribution's insight counters.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCContributionInsightCountersType>

Source

services/insight/index.ts:73


getEmbedsInsightCounters()

static getEmbedsInsightCounters(type, id, config?): Promise<SCEmbedInsightCountersType>

This endpoint retrieves a specific embed's insight counters.

Parameters

ParameterTypeDescription
typestring
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCEmbedInsightCountersType>

Source

services/insight/index.ts:83


getUsersInsightCounters()

static getUsersInsightCounters(id, config?): Promise<SCUsersInsightCountersType>

This endpoint retrieves a specific user's insight counters.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCUsersInsightCountersType>

Source

services/insight/index.ts:92