UserApiClient
Contains all the endpoints needed to manage users.
Constructors
new UserApiClient()
new UserApiClient():
UserApiClient
Returns
Methods
addUserAvatar()
static
addUserAvatar(data
,config
?):Promise
<SCAvatarType
>
This endpoint adds an avatar to my avatars.
Parameters
Parameter | Type | Description |
---|---|---|
data | FormData | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCAvatarType
>
Source
changeUserMail()
static
changeUserMail(id
,new_email
,confirm
?,send_email
?,config
?):Promise
<any
>
This endpoint changes the email of the authenticated user.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
new_email | string | |
confirm ? | boolean | |
send_email ? | boolean | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
changeUserPassword()
static
changeUserPassword(id
,password
,new_password
,config
?):Promise
<any
>
This endpoint changes the password of the authenticated user.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
password | string | |
new_password | string | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
checkUserConnections()
static
checkUserConnections(id
,config
?):Promise
<SCUserConnectionStatusType
>
This endpoint returns is_connection = true if the user (identified in path) is connected with me.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCUserConnectionStatusType
>
Source
checkUserEmailToken()
static
checkUserEmailToken(id
,email_token
,config
?):Promise
<SCUserEmailTokenType
>
This endpoint checks an email token.
Parameters
Parameter | Type | Description |
---|---|---|
id | any | |
email_token | any | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCUserEmailTokenType
>
Source
checkUserFollowed()
static
checkUserFollowed(id
,config
?):Promise
<SCUserFollowedStatusType
>
This endpoint returns is_followed = true if the user (identified in path) is followed by me.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCUserFollowedStatusType
>
Source
checkUserFollower()
static
checkUserFollower(id
,config
?):Promise
<SCUserFollowerStatusType
>
This endpoint returns is_follower = true if the user (identified in path) follow me
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCUserFollowerStatusType
>
Source
checkUserHidden()
static
checkUserHidden(id
,config
?):Promise
<SCUserHiddenStatusType
>
This endpoint returns true if the user (identified in path) is hidden by the authenticated user.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCUserHiddenStatusType
>
Source
checkUserHiddenBy()
static
checkUserHiddenBy(id
,config
?):Promise
<SCUserHiddenByStatusType
>
This endpoint returns true if the user (identified in path) has hidden by the authenticated user.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCUserHiddenByStatusType
>
Source
confirmChangeUserMail()
static
confirmChangeUserMail(id
,new_email
,validation_code
?,config
?):Promise
<any
>
This endpoint confirms email change.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
new_email | string | |
validation_code ? | string | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
createProviderAssociation()
static
createProviderAssociation(data
,config
?):Promise
<SCUserProviderAssociationType
>
This endpoint creates a provider association for a given account.
Parameters
Parameter | Type | Description |
---|---|---|
data | SCUserProviderAssociationType | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCUserProviderAssociationType
>
Source
deleteProviderAssociation()
static
deleteProviderAssociation(data
,config
?):Promise
<any
>
This endpoint deletes a provider association for a given account.
It requires an administration token.
Parameters
Parameter | Type | Description |
---|---|---|
data | DeleteProviderAssociation | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
followUser()
static
followUser(id
,config
?):Promise
<any
>
This endpoint allows a user to follow another user identified by ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
getAllUsers()
static
getAllUsers(params
?,config
?):Promise
<SCPaginatedResponse
<SCUserType
>>
This endpoint retrieves the list of all users
Parameters
Parameter | Type | Description |
---|---|---|
params ? | any | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCUserType
>>
Source
getCurrentUser()
static
getCurrentUser(config
?):Promise
<SCUserType
>
This endpoint returns the user identified by the authentication token.
Parameters
Parameter | Type | Description |
---|---|---|
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCUserType
>
Source
getCurrentUserAvatar()
static
getCurrentUserAvatar(config
?):Promise
<SCUserAvatarType
>
This endpoint returns the url to the user's current avatar.
Parameters
Parameter | Type | Description |
---|---|---|
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCUserAvatarType
>
Source
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
Parameter | Type | Description |
---|---|---|
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCUserPermissionType
>
Source
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
Parameter | Type | Description |
---|---|---|
next ? | string | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPlatformType
>
Source
getHiddenUsers()
static
getHiddenUsers(params
?,config
?):Promise
<SCPaginatedResponse
<SCUserType
>>
This endpoint retrieves the list of all users hidden by the authenticated user
Parameters
Parameter | Type | Description |
---|---|---|
params ? | any | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCUserType
>>
Source
getHiddenUsersId()
static
getHiddenUsersId(params
?,config
?):Promise
<number
[]>
This endpoint retrieves the list of all users hidden id by the authenticated user
Parameters
Parameter | Type | Description |
---|---|---|
params ? | any | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<number
[]>
Source
getProviderAssociations()
static
getProviderAssociations(userId
,config
?):Promise
<SCUserProviderAssociationType
[]>
This endpoint retrieve all provider associations owned by a user
Parameters
Parameter | Type | Description |
---|---|---|
userId | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCUserProviderAssociationType
[]>
Source
getSpecificUser()
static
getSpecificUser(id
,config
?):Promise
<SCUserType
>
This endpoint retrieves a specific user's profile identified by ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCUserType
>
Source
getUserAvatars()
static
getUserAvatars(config
?):Promise
<SCPaginatedResponse
<SCAvatarType
>>
This endpoint retrieves all user avatars.
Parameters
Parameter | Type | Description |
---|---|---|
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCAvatarType
>>
Source
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
Parameter | Type | Description |
---|---|---|
params ? | BaseGetParams | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCUserConnectionRequestType
>>
Source
getUserConnectionStatuses()
static
getUserConnectionStatuses(users
,config
?):Promise
<any
>
This endpoint lists the connection/follow statuses of the logged user starting from a users array.
Parameters
Parameter | Type | Description |
---|---|---|
users | number [] | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
getUserConnections()
static
getUserConnections(id
,params
?,config
?):Promise
<SCPaginatedResponse
<SCUserType
>>
This endpoint retrieves the list of connections of a specific user identified by ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
params ? | UserGetParams | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCUserType
>>
Source
getUserCounters()
static
getUserCounters(id
,config
?):Promise
<SCUserCounterType
>
This endpoint retrieves the counters of a specific user identified by ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCUserCounterType
>
Source
getUserFeed()
static
getUserFeed(id
,params
?,config
?):Promise
<SCPaginatedResponse
<SCFeedUnitType
>>
This endpoint retrieves the list of posts of the user identified by ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
params ? | BaseGetParams | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCFeedUnitType
>>
Source
getUserFollowedCategories()
static
getUserFollowedCategories(id
,mutual
?,config
?):Promise
<SCCategoryType
[]>
This endpoint gets the list of categories followed by the user.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
mutual ? | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCCategoryType
[]>
Source
getUserFollowers()
static
getUserFollowers(id
,params
?,config
?):Promise
<SCPaginatedResponse
<SCUserType
>>
This endpoint retrieves the list of followers of a specific user identified by ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
params ? | UserGetParams | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCUserType
>>
Source
getUserFollowings()
static
getUserFollowings(id
,params
?,config
?):Promise
<SCPaginatedResponse
<SCUserType
>>
This endpoint retrieves the list of following of a specific user identified by ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
params ? | UserGetParams | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCUserType
>>
Source
getUserLoyaltyPoints()
static
getUserLoyaltyPoints(id
,config
?):Promise
<SCUserLoyaltyPointsType
>
This endpoint returns user's loyalty points.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCUserLoyaltyPointsType
>
Source
getUserRequestConnectionsSent()
static
getUserRequestConnectionsSent(params
?,config
?):Promise
<SCPaginatedResponse
<SCUserConnectionRequestType
>>
This endpoint retrieves a specific user's list of connection requests sent by user.
Parameters
Parameter | Type | Description |
---|---|---|
params ? | BaseGetParams | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCUserConnectionRequestType
>>
Source
removeUserAvatar()
static
removeUserAvatar(avatar_id
,config
?):Promise
<any
>
This endpoint removes/deletes an avatar from the authenticated user avatars.
Parameters
Parameter | Type | Description |
---|---|---|
avatar_id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
setUserPrimaryAvatar()
static
setUserPrimaryAvatar(avatar_id
,config
?):Promise
<any
>
This endpoint sets the primary avatar for the authenticated user.
Parameters
Parameter | Type | Description |
---|---|---|
avatar_id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
showHideUser()
static
showHideUser(id
,config
?):Promise
<any
>
This endpoint shows/hides a user (and its posts) identified by ID. for the authenticated user.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
userAcceptRequestConnection()
static
userAcceptRequestConnection(id
,config
?):Promise
<any
>
This endpoint accepts a request connection of the user identified by ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
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
Parameter | Type | Description |
---|---|---|
params | UserAutocompleteParams | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCUserAutocompleteType
>>
Source
userCancelRejectConnectionRequest()
static
userCancelRejectConnectionRequest(id
,config
?):Promise
<any
>
This endpoint cancels reject connection to a user identified by ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
userCancelRequestConnection()
static
userCancelRequestConnection(id
,config
?):Promise
<any
>
This endpoint cancels a request connection for a user.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
userDelete()
static
userDelete(id
,hard
?,config
?):Promise
<any
>
This endpoint deletes a specific user identified by ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
hard ? | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
userMarkSeenConnectionRequest()
static
userMarkSeenConnectionRequest(id
,config
?):Promise
<any
>
This endpoint marks seen a connection request of user identified by ID. for the authenticated user.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
userPatch()
static
userPatch(id
,data
?,config
?):Promise
<SCUserType
>
This endpoint patches a specific user identified by ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
data ? | SCUserType | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCUserType
>
Source
userRejectConnectionRequest()
static
userRejectConnectionRequest(id
,config
?):Promise
<any
>
This endpoint rejects a connection request sent from user identified by ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
userRemoveConnection()
static
userRemoveConnection(id
,config
?):Promise
<any
>
This endpoint removes connection with the user identified by ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
userRequestConnection()
static
userRequestConnection(id
,config
?):Promise
<any
>
This endpoint requests a connection to the user identified by ID.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
userSearch()
static
userSearch(params
,config
?):Promise
<SCPaginatedResponse
<SCUserType
>>
This endpoint performs users search.
Parameters
Parameter | Type | Description |
---|---|---|
params | UserSearchParams | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCUserType
>>
Source
userSettings()
static
userSettings(id
,config
?):Promise
<SCUserSettingsType
>
This endpoint retrieves all current user's settings for the authenticated user.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCUserSettingsType
>
Source
userSettingsPatch()
static
userSettingsPatch(id
,data
?,config
?):Promise
<SCUserSettingsType
>
This endpoint changes the user settings for the authenticated user.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | number | |
data ? | SCUserSettingsType | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCUserSettingsType
>
Source
userTagToAddressContribution()
static
userTagToAddressContribution(config
?):Promise
<SCTagType
>
This endpoint returns user's tags to address a contribution.
Parameters
Parameter | Type | Description |
---|---|---|
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCTagType
>
Source
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
Parameter | Type | Description |
---|---|---|
id | string | number | |
data ? | SCUserType | |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCUserType
>