Skip to main content

CategoryApiClient

Contains all the endpoints needed to manage categories.

Constructors

Constructor

new CategoryApiClient(): CategoryApiClient

Returns

CategoryApiClient

Methods

checkCategoryIsFollowed()

static checkCategoryIsFollowed(id, config?): Promise<SCCategoryFollowedStatusType>

This endpoint returns is_followed = true if the category (identified in path) is followed by the authenticated user.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCCategoryFollowedStatusType>


createCategory()

static createCategory(data, config?): Promise<SCCategoryType>

This endpoint creates a category.

Parameters

ParameterTypeDescription
dataSCCategoryType
config?AxiosRequestConfig

Returns

Promise<SCCategoryType>


deleteASpecificCategory()

static deleteASpecificCategory(id, config?): Promise<any>

This endpoint deletes a specific category identified by ID.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


followCategory()

static followCategory(id, config?): Promise<any>

This endpoint follows a category.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


getAllCategories()

static getAllCategories(params?, config?): Promise<SCPaginatedResponse<SCCategoryType>>

This endpoint retrieves all categories.

Parameters

ParameterTypeDescription
params?CategoryParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCCategoryType>>


getCategoryAudience()

static getCategoryAudience(id, config?): Promise<SCCategoryAudienceType>

This endpoint returns the audience of a specific category.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCCategoryAudienceType>


getCategoryFeed()

static getCategoryFeed(id, params?, config?): Promise<SCPaginatedResponse<SCFeedUnitType>>

This endpoint retrieves the category feed.

Parameters

ParameterTypeDescription
idstring | number
params?BaseGetParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCFeedUnitType>>


getCategoryFollowers()

static getCategoryFollowers(id, params?, config?): Promise<SCPaginatedResponse<SCUserType>>

This endpoint returns all followers of a specific category.

Parameters

ParameterTypeDescription
idstring | number
params?BaseGetParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCUserType>>


getCategoryTrendingFeed()

static getCategoryTrendingFeed(id, params?, config?): Promise<SCPaginatedResponse<SCFeedUnitType>>

This endpoint retrieves the category trending feed.

Parameters

ParameterTypeDescription
idstring | number
params?BaseGetParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCFeedUnitType>>


getCategoryTrendingFollowers()

static getCategoryTrendingFollowers(id, params?, config?): Promise<SCPaginatedResponse<SCUserType>>

This endpoint returns all trending followers of a specific category during last n days (default 90) .

Parameters

ParameterTypeDescription
idstring | number
params?BaseGetParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCUserType>>


getFollowedCategories()

static getFollowedCategories(params?, config?): Promise<SCPaginatedResponse<SCCategoryType>>

This endpoint retrieves all followed categories by the user.

Parameters

ParameterTypeDescription
params?CategoryParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCCategoryType>>


getPopularCategories()

static getPopularCategories(params?, config?): Promise<SCPaginatedResponse<SCCategoryType>>

This endpoint retrieves all categories ordered by the number of followers (in descending order).

Parameters

ParameterTypeDescription
params?BaseGetParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCCategoryType>>


getSpecificCategory()

static getSpecificCategory(id, config?): Promise<SCCategoryType>

This endpoint retrieves a specific category.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCCategoryType>


patchASpecificCategory()

static patchASpecificCategory(id, data, config?): Promise<SCCategoryType>

This endpoint patches a specific category.

Parameters

ParameterTypeDescription
idstring | number
dataSCCategoryType
config?AxiosRequestConfig

Returns

Promise<SCCategoryType>


searchCategory()

static searchCategory(params?, config?): Promise<SCPaginatedResponse<SCCategoryType>>

This endpoint performs category search.

Parameters

ParameterTypeDescription
params?CategoryParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCCategoryType>>


updateASpecificCategory()

static updateASpecificCategory(id, data, config?): Promise<SCCategoryType>

This endpoint updates a specific category.

Parameters

ParameterTypeDescription
idstring | number
dataSCCategoryType
config?AxiosRequestConfig

Returns

Promise<SCCategoryType>