Skip to main content

UserApiClient

Contains all the endpoints needed to manage users.

Constructors

Constructor

new UserApiClient(): UserApiClient

Returns

UserApiClient

Methods

addUserAvatar()

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

This endpoint adds an avatar to my avatars.

Parameters

ParameterTypeDescription
dataFormData
config?AxiosRequestConfig

Returns

Promise<SCAvatarType>


changeUserMail()

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

This endpoint changes the email of the authenticated user.

Parameters

ParameterTypeDescription
idstring | number
new_emailstring
confirm?boolean
send_email?boolean
config?AxiosRequestConfig

Returns

Promise<any>


changeUserPassword()

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

This endpoint changes the password of the authenticated user.

Parameters

ParameterTypeDescription
idstring | number
passwordstring
new_passwordstring
config?AxiosRequestConfig

Returns

Promise<any>


checkUserConnections()

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

This endpoint returns is_connection = true if the user (identified in path) is connected with me.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCUserConnectionStatusType>


checkUserEmailToken()

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

This endpoint checks an email token.

Parameters

ParameterTypeDescription
idany
email_tokenany
config?AxiosRequestConfig

Returns

Promise<SCUserEmailTokenType>


checkUserFollowed()

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

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

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCUserFollowedStatusType>


checkUserFollower()

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

This endpoint returns is_follower = true if the user (identified in path) follow me

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCUserFollowerStatusType>


checkUserHidden()

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

This endpoint returns true if the user (identified in path) is hidden by the authenticated user.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCUserHiddenStatusType>


checkUserHiddenBy()

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

This endpoint returns true if the user (identified in path) has hidden by the authenticated user.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCUserHiddenByStatusType>


confirmChangeUserMail()

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

This endpoint confirms email change.

Parameters

ParameterTypeDescription
idstring | number
new_emailstring
validation_code?string
config?AxiosRequestConfig

Returns

Promise<any>


createProviderAssociation()

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

This endpoint creates a provider association for a given account.

Parameters

ParameterTypeDescription
dataSCUserProviderAssociationType
config?AxiosRequestConfig

Returns

Promise<SCUserProviderAssociationType>


deleteProviderAssociation()

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

This endpoint deletes a provider association for a given account.

It requires an administration token.

Parameters

ParameterTypeDescription
dataDeleteProviderAssociation
config?AxiosRequestConfig

Returns

Promise<any>


followUser()

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

This endpoint allows a user to follow another user identified by ID.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


getAllUsers()

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

This endpoint retrieves the list of all users

Parameters

ParameterTypeDescription
params?any
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCUserType>>


getCurrentUser()

static getCurrentUser(config?): Promise<SCUserType>

This endpoint returns the user identified by the authentication token.

Parameters

ParameterTypeDescription
config?AxiosRequestConfig

Returns

Promise<SCUserType>


getCurrentUserAvatar()

static getCurrentUserAvatar(config?): Promise<SCUserAvatarType>

This endpoint returns the url to the user's current avatar.

Parameters

ParameterTypeDescription
config?AxiosRequestConfig

Returns

Promise<SCUserAvatarType>


getCurrentUserPermission()

static getCurrentUserPermission(config?): Promise<SCUserPermissionType>

This endpoint returns a list of permissions for the user identified by the authentication token. Some permissions in the list depend on global community settings.

Parameters

ParameterTypeDescription
config?AxiosRequestConfig

Returns

Promise<SCUserPermissionType>


getCurrentUserPlatform()

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

This endpoint retrieves the platform url starting from the Authorization user token. Using this url, the logged user (must be a staff member) can access the platform to manage the community.

Parameters

ParameterTypeDescription
next?string
config?AxiosRequestConfig

Returns

Promise<SCPlatformType>


getHiddenUsers()

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

This endpoint retrieves the list of all users hidden by the authenticated user

Parameters

ParameterTypeDescription
params?any
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCUserType>>


getHiddenUsersId()

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

This endpoint retrieves the list of all users hidden id by the authenticated user

Parameters

ParameterTypeDescription
params?any
config?AxiosRequestConfig

Returns

Promise<number[]>


getProviderAssociations()

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

This endpoint retrieve all provider associations owned by a user

Parameters

ParameterTypeDescription
userIdstring | number
config?AxiosRequestConfig

Returns

Promise<SCUserProviderAssociationType[]>


getSpecificUser()

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

This endpoint retrieves a specific user's profile identified by ID.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCUserType>


getUserAvatars()

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

This endpoint retrieves all user avatars.

Parameters

ParameterTypeDescription
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCAvatarType>>


getUserConnectionRequests()

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

This endpoint retrieves the list of connection requests received by a specific user identified by ID.

Parameters

ParameterTypeDescription
params?BaseGetParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCUserConnectionRequestType>>


getUserConnections()

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

This endpoint retrieves the list of connections of a specific user identified by ID.

Parameters

ParameterTypeDescription
idstring | number
params?UserGetParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCUserType>>


getUserConnectionStatuses()

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

This endpoint lists the connection/follow statuses of the logged user starting from a users array.

Parameters

ParameterTypeDescription
usersnumber[]
config?AxiosRequestConfig

Returns

Promise<any>


getUserCounters()

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

This endpoint retrieves the counters of a specific user identified by ID.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCUserCounterType>


getUserFeed()

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

This endpoint retrieves the list of posts of the user identified by ID.

Parameters

ParameterTypeDescription
idstring | number
params?BaseGetParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCFeedUnitType>>


getUserFollowedCategories()

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

This endpoint gets the list of categories followed by the user.

Parameters

ParameterTypeDescription
idstring | number
mutual?number
config?AxiosRequestConfig

Returns

Promise<SCCategoryType[]>


getUserFollowers()

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

This endpoint retrieves the list of followers of a specific user identified by ID.

Parameters

ParameterTypeDescription
idstring | number
params?UserGetParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCUserType>>


getUserFollowings()

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

This endpoint retrieves the list of following of a specific user identified by ID.

Parameters

ParameterTypeDescription
idstring | number
params?UserGetParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCUserType>>


getUserLiveStream()

static getUserLiveStream(id, params?, config?): Promise<SCPaginatedResponse<SCLiveStreamType>>

This endpoint retrieves the list of live stream currently started by user identified by ID.

Parameters

ParameterTypeDescription
idstring | number
params?BaseGetParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCLiveStreamType>>


getUserLoyaltyPoints()

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

This endpoint returns user's loyalty points.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCUserLoyaltyPointsType>


getUserRequestConnectionsSent()

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

This endpoint retrieves a specific user's list of connection requests sent by user.

Parameters

ParameterTypeDescription
params?BaseGetParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCUserConnectionRequestType>>


removeUserAvatar()

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

This endpoint removes/deletes an avatar from the authenticated user avatars.

Parameters

ParameterTypeDescription
avatar_idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


setUserPrimaryAvatar()

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

This endpoint sets the primary avatar for the authenticated user.

Parameters

ParameterTypeDescription
avatar_idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


showHideUser()

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

This endpoint shows/hides a user (and its posts) identified by ID. for the authenticated user.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


userAcceptRequestConnection()

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

This endpoint accepts a request connection of the user identified by ID.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


userAutocomplete()

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

This endpoint retrieves the list of all users that meet the search criteria. The user object returned will contain only the following attributes: id, username, real_name, ext_id and avatar. This endpoint is recommended for implementing an autocomplete input field.

Parameters

ParameterTypeDescription
paramsUserAutocompleteParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCUserAutocompleteType>>


userCancelRejectConnectionRequest()

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

This endpoint cancels reject connection to a user identified by ID.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


userCancelRequestConnection()

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

This endpoint cancels a request connection for a user.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


userDelete()

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

This endpoint deletes a specific user identified by ID.

Parameters

ParameterTypeDescription
idstring | number
hard?number
config?AxiosRequestConfig

Returns

Promise<any>


userMarkSeenConnectionRequest()

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

This endpoint marks seen a connection request of user identified by ID. for the authenticated user.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


userPatch()

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

This endpoint patches a specific user identified by ID.

Parameters

ParameterTypeDescription
idstring | number
data?SCUserType
config?AxiosRequestConfig

Returns

Promise<SCUserType>


userRejectConnectionRequest()

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

This endpoint rejects a connection request sent from user identified by ID.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


userRemoveConnection()

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

This endpoint removes connection with the user identified by ID.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


userRequestConnection()

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

This endpoint requests a connection to the user identified by ID.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


userSearch()

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

This endpoint performs users search.

Parameters

ParameterTypeDescription
paramsUserSearchParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCUserType>>


userSettings()

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

This endpoint retrieves all current user's settings for the authenticated user.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCUserSettingsType>


userSettingsPatch()

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

This endpoint changes the user settings for the authenticated user.

Parameters

ParameterTypeDescription
idstring | number
data?SCUserSettingsType
config?AxiosRequestConfig

Returns

Promise<SCUserSettingsType>


userTagToAddressContribution()

static userTagToAddressContribution(config?): Promise<SCTagType>

This endpoint returns user's tags to address a contribution.

Parameters

ParameterTypeDescription
config?AxiosRequestConfig

Returns

Promise<SCTagType>


userUpdate()

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

This endpoint updates the profile of a user identified by ID. A user can only update their personal data. If the request is willing to update the avatar or the cover the 'Content-Type' request header must be set as 'multipart/form-data', otherwise it can be 'application/x-www-form-urlencoded'.

Parameters

ParameterTypeDescription
idstring | number
data?SCUserType
config?AxiosRequestConfig

Returns

Promise<SCUserType>