Skip to main content

Class: InsightApiClient

services/insight.InsightApiClient

Contains all the endpoints needed to manage insights.

Constructors

constructor

new InsightApiClient(): InsightApiClient

Returns

InsightApiClient

Methods

getBestContributionInsight

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

This endpoint retrieves the best contribution insights list.

Parameters

NameType
params?InsightContributionParams
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCContributionInsightType>>

Defined in

services/insight/index.ts:36


getBestEmbedInsight

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_vimeo', 'sc_link', 'sc_shared_object').

Parameters

NameType
params?InsightEmbedParams
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCEmbedInsightType>>

Defined in

services/insight/index.ts:53


getBestUsersInsight

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

This endpoint retrieves the best users insights list.

Parameters

NameType
params?InsightUserParams
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCUsersInsightType>>

Defined in

services/insight/index.ts:63


getContributionsInsightCounters

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

This endpoint retrieves a specific contribution's insight counters.

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCContributionInsightCountersType>

Defined in

services/insight/index.ts:73


getEmbedsInsightCounters

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

This endpoint retrieves a specific embed's insight counters.

Parameters

NameType
typestring
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCEmbedInsightCountersType>

Defined in

services/insight/index.ts:83


getUsersInsightCounters

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

This endpoint retrieves a specific user's insight counters.

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCUsersInsightCountersType>

Defined in

services/insight/index.ts:92