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