Skip to main content

Class: UserApiClient

services/user.UserApiClient

Contains all the endpoints needed to manage users.

Constructors

constructor

new UserApiClient(): UserApiClient

Returns

UserApiClient

Methods

addUserAvatar

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

This endpoint adds an avatar to my avatars.

Parameters

NameType
dataFormData
config?AxiosRequestConfig<any>

Returns

Promise<SCAvatarType>

Defined in

services/user/index.ts:571


changeUserMail

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

This endpoint changes the email of the authenticated user.

Parameters

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

Returns

Promise<any>

Defined in

services/user/index.ts:213


changeUserPassword

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

This endpoint changes the password of the authenticated user.

Parameters

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

Returns

Promise<any>

Defined in

services/user/index.ts:258


checkUserConnections

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

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

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCUserConnectionStatusType>

Defined in

services/user/index.ts:405


checkUserEmailToken

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

This endpoint checks an email token.

Parameters

NameType
idany
email_tokenany
config?AxiosRequestConfig<any>

Returns

Promise<SCUserEmailTokenType>

Defined in

services/user/index.ts:561


checkUserFollowed

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

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

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCUserFollowedStatusType>

Defined in

services/user/index.ts:377


checkUserFollower

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

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

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCUserFollowerStatusType>

Defined in

services/user/index.ts:386


checkUserHidden

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

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

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCUserHiddenStatusType>

Defined in

services/user/index.ts:511


checkUserHiddenBy

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

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

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCUserHiddenByStatusType>

Defined in

services/user/index.ts:520


confirmChangeUserMail

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

This endpoint confirms email change.

Parameters

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

Returns

Promise<any>

Defined in

services/user/index.ts:239


createProviderAssociation

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

This endpoint creates a provider association for a given account.

Parameters

NameType
dataSCUserProviderAssociationType
config?AxiosRequestConfig<any>

Returns

Promise<SCUserProviderAssociationType>

Defined in

services/user/index.ts:620


deleteProviderAssociation

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

This endpoint deletes a provider association for a given account.

It requires an administration token.

Parameters

NameType
dataDeleteProviderAssociation
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/user/index.ts:636


followUser

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

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

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/user/index.ts:368


getAllUsers

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

This endpoint retrieves the list of all users

Parameters

NameType
params?any
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCUserType>>

Defined in

services/user/index.ts:110


getCurrentUser

getCurrentUser(config?): Promise<SCUserType>

This endpoint returns the user identified by the authentication token.

Parameters

NameType
config?AxiosRequestConfig<any>

Returns

Promise<SCUserType>

Defined in

services/user/index.ts:293


getCurrentUserAvatar

getCurrentUserAvatar(config?): Promise<SCUserAvatarType>

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

Parameters

NameType
config?AxiosRequestConfig<any>

Returns

Promise<SCUserAvatarType>

Defined in

services/user/index.ts:301


getCurrentUserPermission

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

NameType
config?AxiosRequestConfig<any>

Returns

Promise<SCUserPermissionType>

Defined in

services/user/index.ts:309


getCurrentUserPlatform

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

NameType
next?string
config?AxiosRequestConfig<any>

Returns

Promise<SCPlatformType>

Defined in

services/user/index.ts:318


getHiddenUsers

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

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

Parameters

NameType
params?any
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCUserType>>

Defined in

services/user/index.ts:120


getHiddenUsersId

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

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

Parameters

NameType
params?any
config?AxiosRequestConfig<any>

Returns

Promise<number[]>

Defined in

services/user/index.ts:130


getProviderAssociations

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

This endpoint retrieve all provider associations owned by a user

Parameters

NameType
userIdstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCUserProviderAssociationType[]>

Defined in

services/user/index.ts:607


getSpecificUser

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

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

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCUserType>

Defined in

services/user/index.ts:161


getUserAvatars

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

This endpoint retrieves all user avatars.

Parameters

NameType
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCAvatarType>>

Defined in

services/user/index.ts:579


getUserConnectionRequests

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

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

Parameters

NameType
params?BaseGetParams
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCUserConnectionRequestType>>

Defined in

services/user/index.ts:414


getUserConnectionStatuses

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

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

Parameters

NameType
usersnumber[]
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/user/index.ts:538


getUserConnections

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

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

Parameters

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

Returns

Promise<SCPaginatedResponse<SCUserType>>

Defined in

services/user/index.ts:396


getUserCounters

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

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

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCUserCounterType>

Defined in

services/user/index.ts:170


getUserFeed

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

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

Parameters

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

Returns

Promise<SCPaginatedResponse<SCFeedUnitType>>

Defined in

services/user/index.ts:339


getUserFollowedCategories

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

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

Parameters

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

Returns

Promise<SCCategoryType[]>

Defined in

services/user/index.ts:329


getUserFollowers

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

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

Parameters

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

Returns

Promise<SCPaginatedResponse<SCUserType>>

Defined in

services/user/index.ts:349


getUserFollowings

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

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

Parameters

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

Returns

Promise<SCPaginatedResponse<SCUserType>>

Defined in

services/user/index.ts:359


getUserLoyaltyPoints

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

This endpoint returns user's loyalty points.

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCUserLoyaltyPointsType>

Defined in

services/user/index.ts:529


getUserRequestConnectionsSent

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

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

Parameters

NameType
params?BaseGetParams
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCUserConnectionRequestType>>

Defined in

services/user/index.ts:423


removeUserAvatar

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

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

Parameters

NameType
avatar_idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/user/index.ts:588


setUserPrimaryAvatar

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

This endpoint sets the primary avatar for the authenticated user.

Parameters

NameType
avatar_idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/user/index.ts:597


showHideUser

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

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

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/user/index.ts:502


userAcceptRequestConnection

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

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

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/user/index.ts:435


userAutocomplete

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

NameType
paramsUserAutocompleteParams
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCUserAutocompleteType>>

Defined in

services/user/index.ts:141


userCancelRejectConnectionRequest

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

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

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/user/index.ts:462


userCancelRequestConnection

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

This endpoint cancels a request connection for a user.

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/user/index.ts:475


userDelete

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

This endpoint deletes a specific user identified by ID.

Parameters

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

Returns

Promise<any>

Defined in

services/user/index.ts:201


userMarkSeenConnectionRequest

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

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

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/user/index.ts:493


userPatch

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

This endpoint patches a specific user identified by ID.

Parameters

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

Returns

Promise<SCUserType>

Defined in

services/user/index.ts:191


userRejectConnectionRequest

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

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

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/user/index.ts:484


userRemoveConnection

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

This endpoint removes connection with the user identified by ID.

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/user/index.ts:453


userRequestConnection

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

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

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/user/index.ts:444


userSearch

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

This endpoint performs users search.

Parameters

NameType
paramsUserSearchParams
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCUserType>>

Defined in

services/user/index.ts:151


userSettings

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

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

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCUserSettingsType>

Defined in

services/user/index.ts:275


userSettingsPatch

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

This endpoint changes the user settings for the authenticated user.

Parameters

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

Returns

Promise<SCUserSettingsType>

Defined in

services/user/index.ts:285


userTagToAddressContribution

userTagToAddressContribution(config?): Promise<SCTagType>

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

Parameters

NameType
config?AxiosRequestConfig<any>

Returns

Promise<SCTagType>

Defined in

services/user/index.ts:551


userUpdate

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

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

Returns

Promise<SCUserType>

Defined in

services/user/index.ts:181