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
Parameter | Type | Description |
---|---|---|
id | string | number | |
config? | AxiosRequestConfig |
Returns
Promise
<SCCategoryFollowedStatusType
>
createCategory()
static
createCategory(data
,config?
):Promise
<SCCategoryType
>
This endpoint creates a category.
Parameters
Parameter | Type | Description |
---|---|---|
data | SCCategoryType | |
config? | AxiosRequestConfig |
Returns
Promise
<SCCategoryType
>
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 |
Returns
Promise
<any
>
followCategory()
static
followCategory(id
,config?
):Promise
<any
>
This endpoint follows a category.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
config? | AxiosRequestConfig |
Returns
Promise
<any
>
getAllCategories()
static
getAllCategories(params?
,config?
):Promise
<SCPaginatedResponse
<SCCategoryType
>>
This endpoint retrieves all categories.
Parameters
Parameter | Type | Description |
---|---|---|
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
Parameter | Type | Description |
---|---|---|
id | string | number | |
config? | AxiosRequestConfig |
Returns
Promise
<SCCategoryAudienceType
>
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 |
Returns
Promise
<SCPaginatedResponse
<SCFeedUnitType
>>
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 |
Returns
Promise
<SCPaginatedResponse
<SCUserType
>>
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 |
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
Parameter | Type | Description |
---|---|---|
id | string | 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
Parameter | Type | Description |
---|---|---|
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
Parameter | Type | Description |
---|---|---|
params? | BaseGetParams | |
config? | AxiosRequestConfig |
Returns
Promise
<SCPaginatedResponse
<SCCategoryType
>>
getSpecificCategory()
static
getSpecificCategory(id
,config?
):Promise
<SCCategoryType
>
This endpoint retrieves a specific category.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
config? | AxiosRequestConfig |
Returns
Promise
<SCCategoryType
>
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 |
Returns
Promise
<SCCategoryType
>
searchCategory()
static
searchCategory(params?
,config?
):Promise
<SCPaginatedResponse
<SCCategoryType
>>
This endpoint performs category search.
Parameters
Parameter | Type | Description |
---|---|---|
params? | CategoryParams | |
config? | AxiosRequestConfig |
Returns
Promise
<SCPaginatedResponse
<SCCategoryType
>>
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 |
Returns
Promise
<SCCategoryType
>