Skip to main content

Class: CategoryApiClient

services/category.CategoryApiClient

Contains all the endpoints needed to manage categories.

Constructors

constructor

new CategoryApiClient(): CategoryApiClient

Returns

CategoryApiClient

Methods

checkCategoryIsFollowed

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

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

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCCategoryFollowedStatusType>

Defined in

services/category/index.ts:167


createCategory

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

This endpoint creates a category.

Parameters

NameType
dataSCCategoryType
config?AxiosRequestConfig<any>

Returns

Promise<SCCategoryType>

Defined in

services/category/index.ts:56


deleteASpecificCategory

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

This endpoint deletes a specific category identified by ID.

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/category/index.ts:94


followCategory

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

This endpoint follows a category.

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/category/index.ts:158


getAllCategories

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

This endpoint retrieves all categories.

Parameters

NameType
params?CategoryParams
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCCategoryType>>

Defined in

services/category/index.ts:36


getCategoryAudience

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

This endpoint returns the audience of a specific category.

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCCategoryAudienceType>

Defined in

services/category/index.ts:103


getCategoryFeed

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

This endpoint retrieves the category feed.

Parameters

NameType
idstring | number
params?BaseGetParams
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCFeedUnitType>>

Defined in

services/category/index.ts:121


getCategoryFollowers

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

This endpoint returns all followers of a specific category.

Parameters

NameType
idstring | number
params?BaseGetParams
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCUserType>>

Defined in

services/category/index.ts:112


getCategoryTrendingFeed

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

This endpoint retrieves the category trending feed.

Parameters

NameType
idstring | number
params?BaseGetParams
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCFeedUnitType>>

Defined in

services/category/index.ts:131


getCategoryTrendingFollowers

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

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

Parameters

NameType
idstring | number
params?BaseGetParams
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCUserType>>

Defined in

services/category/index.ts:145


getFollowedCategories

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

This endpoint retrieves all followed categories by the user.

Parameters

NameType
params?CategoryParams
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCCategoryType>>

Defined in

services/category/index.ts:176


getPopularCategories

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

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

Parameters

NameType
params?BaseGetParams
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCCategoryType>>

Defined in

services/category/index.ts:186


getSpecificCategory

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

This endpoint retrieves a specific category.

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCCategoryType>

Defined in

services/category/index.ts:65


patchASpecificCategory

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

This endpoint patches a specific category.

Parameters

NameType
idstring | number
dataSCCategoryType
config?AxiosRequestConfig<any>

Returns

Promise<SCCategoryType>

Defined in

services/category/index.ts:85


searchCategory

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

This endpoint performs category search.

Parameters

NameType
params?CategoryParams
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCCategoryType>>

Defined in

services/category/index.ts:46


updateASpecificCategory

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

This endpoint updates a specific category.

Parameters

NameType
idstring | number
dataSCCategoryType
config?AxiosRequestConfig<any>

Returns

Promise<SCCategoryType>

Defined in

services/category/index.ts:75