ProfileRestClient class

Base class that should be used (derived from) to make requests to VSS REST apis

Extends

Constructors

ProfileRestClient(IVssRestClientOptions)

Properties

RESOURCE_AREA_ID

Methods

createProfile(CreateProfileContext, boolean)

Create profile

deleteProfileAttribute(string, string)
getAvatar(string, string, string)
getAvatarPreview(any, string, string, string, string)
getProfile(string, boolean, boolean, string, string, boolean)

Gets a user profile.

getProfileAttribute(string, string)
getProfileAttributes(string, string, string, string, boolean, string)
resetAvatar(string)
setAvatar(any, string)
setProfileAttribute(any, string, string)
setProfileAttributes(VssJsonCollectionWrapperV<ProfileAttributeBase<any>[]>, string)
updateProfile(Profile, string)

Update profile

Constructor Details

ProfileRestClient(IVssRestClientOptions)

new ProfileRestClient(options: IVssRestClientOptions)

Parameters

Property Details

RESOURCE_AREA_ID

static RESOURCE_AREA_ID: string

Property Value

string

Method Details

createProfile(CreateProfileContext, boolean)

Create profile

function createProfile(createProfileContext: CreateProfileContext, autoCreate?: boolean): Promise<Profile>

Parameters

createProfileContext
CreateProfileContext

Context for profile creation

autoCreate

boolean

Create profile automatically

Returns

Promise<Profile>

deleteProfileAttribute(string, string)

function deleteProfileAttribute(id: string, descriptor: string): Promise<void>

Parameters

id

string

descriptor

string

Returns

Promise<void>

getAvatar(string, string, string)

function getAvatar(id: string, size?: string, format?: string): Promise<Avatar>

Parameters

id

string

size

string

format

string

Returns

Promise<Avatar>

getAvatarPreview(any, string, string, string, string)

function getAvatarPreview(container: any, id: string, size?: string, format?: string, displayName?: string): Promise<Avatar>

Parameters

container

any

id

string

size

string

format

string

displayName

string

Returns

Promise<Avatar>

getProfile(string, boolean, boolean, string, string, boolean)

Gets a user profile.

function getProfile(id: string, details?: boolean, withAttributes?: boolean, partition?: string, coreAttributes?: string, forceRefresh?: boolean): Promise<Profile>

Parameters

id

string

The ID of the target user profile within the same organization, or 'me' to get the profile of the current authenticated user.

details

boolean

Return public profile information such as display name, email address, country, etc. If false, the withAttributes parameter is ignored.

withAttributes

boolean

If true, gets the attributes (named key-value pairs of arbitrary data) associated with the profile. The partition parameter must also have a value.

partition

string

The partition (named group) of attributes to return.

coreAttributes

string

A comma-delimited list of core profile attributes to return. Valid values are Email, Avatar, DisplayName, and ContactWithOffers.

forceRefresh

boolean

Not used in this version of the API.

Returns

Promise<Profile>

getProfileAttribute(string, string)

function getProfileAttribute(id: string, descriptor: string): Promise<ProfileAttribute>

Parameters

id

string

descriptor

string

Returns

Promise<ProfileAttribute>

getProfileAttributes(string, string, string, string, boolean, string)

function getProfileAttributes(id: string, partition: string, modifiedSince?: string, modifiedAfterRevision?: string, withCoreAttributes?: boolean, coreAttributes?: string): Promise<ProfileAttribute[]>

Parameters

id

string

partition

string

modifiedSince

string

modifiedAfterRevision

string

withCoreAttributes

boolean

coreAttributes

string

Returns

Promise<ProfileAttribute[]>

resetAvatar(string)

function resetAvatar(id: string): Promise<void>

Parameters

id

string

Returns

Promise<void>

setAvatar(any, string)

function setAvatar(container: any, id: string): Promise<void>

Parameters

container

any

id

string

Returns

Promise<void>

setProfileAttribute(any, string, string)

function setProfileAttribute(container: any, id: string, descriptor: string): Promise<void>

Parameters

container

any

id

string

descriptor

string

Returns

Promise<void>

setProfileAttributes(VssJsonCollectionWrapperV<ProfileAttributeBase<any>[]>, string)

function setProfileAttributes(attributesCollection: VssJsonCollectionWrapperV<ProfileAttributeBase<any>[]>, id: string): Promise<void>

Parameters

attributesCollection

VssJsonCollectionWrapperV<ProfileAttributeBase<any>[]>

id

string

Returns

Promise<void>

updateProfile(Profile, string)

Update profile

function updateProfile(profile: Profile, id: string): Promise<void>

Parameters

profile
Profile

Update profile

id

string

Profile ID

Returns

Promise<void>