Skip to main content

UserService

User service can be used in the following way:
1. Import the service from our library:

import {UserService} from "@selfcommunity/api-services";
2. Create a function and put the service inside it!
The async function `getAllUsers` will return the paginated list of users.

async getAllUsers() {
return await UserService.getAllUsers();
}
In case of required `params`, just add them inside the brackets.

async getSpecificUser(userId) {
return await UserService.getSpecificUser(userId);
}
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).

Ex: If the async function `userUpdate` is willing to update the avatar or the cover the 'Content-Type' request header must be set as 'multipart/form-data'.

async getSpecificUser(userId, data, config) {
const headers = {headers: {'Content-Type': 'multipart/form-data'}}
return await UserService.getSpecificUser(userId, {avatar: avatar}, headers);
}

Constructors

new UserService()

new UserService(): UserService

Returns

UserService

Methods

addUserAvatar()

static addUserAvatar(data, config?): Promise<SCAvatarType>

Parameters

ParameterType
dataFormData
config?AxiosRequestConfig<any>

Returns

Promise<SCAvatarType>

Source

services/user/index.ts:834


changeUserMail()

static changeUserMail(id, new_email, confirm?, send_email?, config?): Promise<any>

Parameters

ParameterType
idstring | number
new_emailstring
confirm?boolean
send_email?boolean
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/user/index.ts:716


changeUserPassword()

static changeUserPassword(id, password, new_password, config?): Promise<any>

Parameters

ParameterType
idstring | number
passwordstring
new_passwordstring
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/user/index.ts:728


checkUserConnections()

static checkUserConnections(id, config?): Promise<SCUserConnectionStatusType>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCUserConnectionStatusType>

Source

services/user/index.ts:777


checkUserEmailToken()

static checkUserEmailToken(id, email_token, config?): Promise<SCUserEmailTokenType>

Parameters

ParameterType
idstring | number
email_tokenany
config?AxiosRequestConfig<any>

Returns

Promise<SCUserEmailTokenType>

Source

services/user/index.ts:831


checkUserFollowed()

static checkUserFollowed(id, config?): Promise<SCUserFollowedStatusType>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCUserFollowedStatusType>

Source

services/user/index.ts:764


checkUserFollower()

static checkUserFollower(id, config?): Promise<SCUserFollowerStatusType>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCUserFollowerStatusType>

Source

services/user/index.ts:767


checkUserHidden()

static checkUserHidden(id, config?): Promise<SCUserHiddenStatusType>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCUserHiddenStatusType>

Source

services/user/index.ts:816


checkUserHiddenBy()

static checkUserHiddenBy(id, config?): Promise<SCUserHiddenByStatusType>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCUserHiddenByStatusType>

Source

services/user/index.ts:819


confirmChangeUserMail()

static confirmChangeUserMail(id, new_email, validation_code?, config?): Promise<any>

Parameters

ParameterType
idstring | number
new_emailstring
validation_code?string
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/user/index.ts:725


createProviderAssociation()

static createProviderAssociation(data, config?): Promise<SCUserProviderAssociationType>

Parameters

ParameterType
dataSCUserProviderAssociationType
config?AxiosRequestConfig<any>

Returns

Promise<SCUserProviderAssociationType>

Source

services/user/index.ts:849


deleteProviderAssociation()

static deleteProviderAssociation(data, config?): Promise<any>

Parameters

ParameterType
dataDeleteProviderAssociation
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/user/index.ts:852


followUser()

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

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/user/index.ts:761


getAllUsers()

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

Parameters

ParameterType
params?any
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCUserType>>

Source

services/user/index.ts:686


getCurrentUser()

static getCurrentUser(config?): Promise<SCUserType>

Parameters

ParameterType
config?AxiosRequestConfig<any>

Returns

Promise<SCUserType>

Source

services/user/index.ts:737


getCurrentUserAvatar()

static getCurrentUserAvatar(config?): Promise<SCUserAvatarType>

Parameters

ParameterType
config?AxiosRequestConfig<any>

Returns

Promise<SCUserAvatarType>

Source

services/user/index.ts:740


getCurrentUserPermission()

static getCurrentUserPermission(config?): Promise<SCUserPermissionType>

Parameters

ParameterType
config?AxiosRequestConfig<any>

Returns

Promise<SCUserPermissionType>

Source

services/user/index.ts:743


getCurrentUserPlatform()

static getCurrentUserPlatform(next?, config?): Promise<SCPlatformType>

Parameters

ParameterType
next?string
config?AxiosRequestConfig<any>

Returns

Promise<SCPlatformType>

Source

services/user/index.ts:746


getHiddenUsers()

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

Parameters

ParameterType
params?any
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCUserType>>

Source

services/user/index.ts:689


getHiddenUsersId()

static getHiddenUsersId(params?, config?): Promise<number[]>

Parameters

ParameterType
params?any
config?AxiosRequestConfig<any>

Returns

Promise<number[]>

Source

services/user/index.ts:692


getProviderAssociations()

static getProviderAssociations(userId, config?): Promise<SCUserProviderAssociationType[]>

Parameters

ParameterType
userIdstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCUserProviderAssociationType[]>

Source

services/user/index.ts:846


getSpecificUser()

static getSpecificUser(id, config?): Promise<SCUserType>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCUserType>

Source

services/user/index.ts:701


getUserAvatars()

static getUserAvatars(config?): Promise <SCPaginatedResponse<SCAvatarType>>

Parameters

ParameterType
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCAvatarType>>

Source

services/user/index.ts:837


getUserConnectionRequests()

static getUserConnectionRequests(params?, config?): Promise <SCPaginatedResponse<SCUserConnectionRequestType>>

Parameters

ParameterType
params?BaseGetParams
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCUserConnectionRequestType>>

Source

services/user/index.ts:780


getUserConnectionStatuses()

static getUserConnectionStatuses(users, config?): Promise<any>

Parameters

ParameterType
usersnumber[]
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/user/index.ts:825


getUserConnections()

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

Parameters

ParameterType
idstring | number
params?UserGetParams
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCUserType>>

Source

services/user/index.ts:770


getUserCounters()

static getUserCounters(id, config?): Promise<SCUserCounterType>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCUserCounterType>

Source

services/user/index.ts:704


getUserFeed()

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

Parameters

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

Returns

Promise <SCPaginatedResponse<SCFeedUnitType>>

Source

services/user/index.ts:752


getUserFollowedCategories()

static getUserFollowedCategories(id, mutual?, config?): Promise<SCCategoryType[]>

Parameters

ParameterType
idstring | number
mutual?number
config?AxiosRequestConfig<any>

Returns

Promise<SCCategoryType[]>

Source

services/user/index.ts:749


getUserFollowers()

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

Parameters

ParameterType
idstring | number
params?UserGetParams
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCUserType>>

Source

services/user/index.ts:755


getUserFollowings()

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

Parameters

ParameterType
idstring | number
params?UserGetParams
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCUserType>>

Source

services/user/index.ts:758


getUserLoyaltyPoints()

static getUserLoyaltyPoints(id, config?): Promise<SCUserLoyaltyPointsType>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCUserLoyaltyPointsType>

Source

services/user/index.ts:822


getUserRequestConnectionsSent()

static getUserRequestConnectionsSent(params?, config?): Promise <SCPaginatedResponse<SCUserConnectionRequestType>>

Parameters

ParameterType
params?BaseGetParams
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCUserConnectionRequestType>>

Source

services/user/index.ts:786


removeUserAvatar()

static removeUserAvatar(avatar_id, config?): Promise<any>

Parameters

ParameterType
avatar_idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/user/index.ts:840


setUserPrimaryAvatar()

static setUserPrimaryAvatar(avatar_id, config?): Promise<any>

Parameters

ParameterType
avatar_idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/user/index.ts:843


showHideUser()

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

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/user/index.ts:813


userAcceptRequestConnection()

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

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/user/index.ts:792


userAutocomplete()

static userAutocomplete(params, config?): Promise <SCPaginatedResponse<SCUserAutocompleteType>>

Parameters

ParameterType
paramsUserAutocompleteParams
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCUserAutocompleteType>>

Source

services/user/index.ts:695


userCancelRejectConnectionRequest()

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

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/user/index.ts:801


userCancelRequestConnection()

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

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/user/index.ts:804


userDelete()

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

Parameters

ParameterType
idstring | number
hard?number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/user/index.ts:713


userMarkSeenConnectionRequest()

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

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/user/index.ts:810


userPatch()

static userPatch(id, data?, config?): Promise<SCUserType>

Parameters

ParameterType
idstring | number
data?SCUserType
config?AxiosRequestConfig<any>

Returns

Promise<SCUserType>

Source

services/user/index.ts:710


userRejectConnectionRequest()

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

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/user/index.ts:807


userRemoveConnection()

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

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/user/index.ts:798


userRequestConnection()

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

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/user/index.ts:795


userSearch()

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

Parameters

ParameterType
paramsUserSearchParams
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCUserType>>

Source

services/user/index.ts:698


userSettings()

static userSettings(id, config?): Promise<SCUserSettingsType>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCUserSettingsType>

Source

services/user/index.ts:731


userSettingsPatch()

static userSettingsPatch(id, data?, config?): Promise<SCUserSettingsType>

Parameters

ParameterType
idstring | number
data?SCUserSettingsType
config?AxiosRequestConfig<any>

Returns

Promise<SCUserSettingsType>

Source

services/user/index.ts:734


userTagToAddressContribution()

static userTagToAddressContribution(config?): Promise<SCTagType>

Parameters

ParameterType
config?AxiosRequestConfig<any>

Returns

Promise<SCTagType>

Source

services/user/index.ts:828


userUpdate()

static userUpdate(id, data?, config?): Promise<SCUserType>

Parameters

ParameterType
idstring | number
data?SCUserType
config?AxiosRequestConfig<any>

Returns

Promise<SCUserType>

Source

services/user/index.ts:707