CategoryApiClient
Contains all the endpoints needed to manage categories.
Constructors
new CategoryApiClient()
new CategoryApiClient():
CategoryApiClient
Returns
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
Parameter | Type | Description |
---|---|---|
id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCCategoryFollowedStatusType
>
Source
services/category/index.ts:166
createCategory()
static
createCategory(data
,config
?):Promise
<SCCategoryType
>
This endpoint creates a category.
Parameters
Parameter | Type | Description |
---|---|---|
data | SCCategoryType | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCCategoryType
>
Source
deleteASpecificCategory()
static
deleteASpecificCategory(id
,config
?):Promise
<any
>
This endpoint deletes a specific category identified by ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
followCategory()
static
followCategory(id
,config
?):Promise
<any
>
This endpoint follows a category.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
services/category/index.ts:157
getAllCategories()
static
getAllCategories(params
?,config
?):Promise
<SCPaginatedResponse
<SCCategoryType
>>
This endpoint retrieves all categories.
Parameters
Parameter | Type | Description |
---|---|---|
params ? | CategoryParams | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCCategoryType
>>
Source
getCategoryAudience()
static
getCategoryAudience(id
,config
?):Promise
<SCCategoryAudienceType
>
This endpoint returns the audience of a specific category.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCCategoryAudienceType
>
Source
services/category/index.ts:100
getCategoryFeed()
static
getCategoryFeed(id
,params
?,config
?):Promise
<SCPaginatedResponse
<SCFeedUnitType
>>
This endpoint retrieves the category feed.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
params ? | BaseGetParams | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCFeedUnitType
>>
Source
services/category/index.ts:120
getCategoryFollowers()
static
getCategoryFollowers(id
,params
?,config
?):Promise
<SCPaginatedResponse
<SCUserType
>>
This endpoint returns all followers of a specific category.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
params ? | BaseGetParams | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCUserType
>>
Source
services/category/index.ts:110
getCategoryTrendingFeed()
static
getCategoryTrendingFeed(id
,params
?,config
?):Promise
<SCPaginatedResponse
<SCFeedUnitType
>>
This endpoint retrieves the category trending feed.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
params ? | BaseGetParams | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCFeedUnitType
>>
Source
services/category/index.ts:130
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
Parameter | Type | Description |
---|---|---|
id | string | number | |
params ? | BaseGetParams | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCUserType
>>
Source
services/category/index.ts:144
getFollowedCategories()
static
getFollowedCategories(params
?,config
?):Promise
<SCPaginatedResponse
<SCCategoryType
>>
This endpoint retrieves all followed categories by the user.
Parameters
Parameter | Type | Description |
---|---|---|
params ? | CategoryParams | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCCategoryType
>>
Source
services/category/index.ts:175
getPopularCategories()
static
getPopularCategories(params
?,config
?):Promise
<SCPaginatedResponse
<SCCategoryType
>>
This endpoint retrieves all categories ordered by the number of followers (in descending order).
Parameters
Parameter | Type | Description |
---|---|---|
params ? | BaseGetParams | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCCategoryType
>>
Source
services/category/index.ts:184
getSpecificCategory()
static
getSpecificCategory(id
,config
?):Promise
<SCCategoryType
>
This endpoint retrieves a specific category.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCCategoryType
>
Source
patchASpecificCategory()
static
patchASpecificCategory(id
,data
,config
?):Promise
<SCCategoryType
>
This endpoint patches a specific category.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
data | SCCategoryType | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCCategoryType
>
Source
searchCategory()
static
searchCategory(params
?,config
?):Promise
<SCPaginatedResponse
<SCCategoryType
>>
This endpoint performs category search.
Parameters
Parameter | Type | Description |
---|---|---|
params ? | CategoryParams | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCCategoryType
>>
Source
updateASpecificCategory()
static
updateASpecificCategory(id
,data
,config
?):Promise
<SCCategoryType
>
This endpoint updates a specific category.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
data | SCCategoryType | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCCategoryType
>