UserProfiles Class

Access user profile data. The user profile data populates the profile page (also called the Chatter profile page). This data includes user information (such as address, manager, and phone number), some user capabilities (permissions), and a set of subtab apps, which are custom tabs on the profile page.

ConnectApi

These methods are for UserProfiles. All methods are static.

All methods in this class require Chatter and are subject to the per user, per namespace, per hour rate limit.

Delete a user’s banner photo.

36.0

Yes

public static Void deleteBannerPhoto(String communityId, String userId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

userId

Type: String

ID of the user.

Type: Void

Delete a user’s photo.

35.0

Yes

public static Void deletePhoto(String communityId, String userId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

userId

Type: String

ID for the context user or the keyword me.

Type: Void

Get a user’s banner photo.

36.0

Yes

public static ConnectApi.BannerPhoto getBannerPhoto(String communityId, String userId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

userId

Type: String

ID of the user.

Type: ConnectApi.BannerPhoto

Get a user’s photo.

35.0

35.0

Yes

public static ConnectApi.Photo getPhoto(String communityId, String userId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

userId

Type: String

ID for a user.

Type: ConnectApi.Photo

Get the user profile of the context user.

29.0

Yes

public static ConnectApi.UserProfile getUserProfile(String communityId, String userId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

userId

Type: String

ID for a user.

Type: ConnectApi.UserProfile

Set an uploaded file as a user’s banner photo.

36.0

Yes

public static ConnectApi.BannerPhoto setBannerPhoto(String communityId, String userId, String fileId, Integer versionNumber)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

userId

Type: String

ID of the user.

fileId

Type: String

ID of the uploaded file to use as the user banner. The key prefix must be 069, and the image must be smaller than 8 MB.

versionNumber

Type: Integer

Version number of the file. Specify an existing version number or, to get the latest version, specify null.

Type: ConnectApi.BannerPhoto

Photos are processed asynchronously and might not be visible right away.

Set a file that hasn’t been uploaded as a user’s banner photo.

36.0

Yes

public static ConnectApi.BannerPhoto setBannerPhoto(String communityId, String userId, ConnectApi.BinaryInput fileUpload)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

userId

Type: String

ID of the user.

fileUpload

Type: ConnectApi.Binary​​Input

File to use as the photo. The content type must be usable as an image.

Type: ConnectApi.BannerPhoto

Photos are processed asynchronously and might not be visible right away.

Set and crop an uploaded file as a user’s banner photo.

36.0

Yes

public static ConnectApi.BannerPhoto setBannerPhotoWithAttributes(String communityId, String userId, ConnectApi.BannerPhotoInput bannerPhoto)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

userId

Type: String

ID of the user.

bannerPhoto

Type: ConnectApi.BannerPhotoInput

A ConnectApi.BannerPhotoInput object that specifies the ID and version of the file, and how to crop the file.

Type: ConnectApi.BannerPhoto

Photos are processed asynchronously and might not be visible right away.

Set and crop a file that hasn’t been uploaded as a user’s banner photo.

36.0

Yes

public static ConnectApi.BannerPhoto setBannerPhotoWithAttributes(String communityId, String userId, ConnectApi.BannerPhotoInput bannerPhoto, ConnectApi.BinaryInput fileUpload)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

userId

Type: String

ID of the user.

bannerPhoto

Type: ConnectApi.BannerPhotoInput

A ConnectApi.BannerPhotoInput object specifying the cropping parameters.

fileUpload

Type: ConnectApi.Binary​​Input

File to use as the photo. The content type must be usable as an image.

Type: ConnectApi.BannerPhoto

Photos are processed asynchronously and might not be visible right away.

Set an uploaded file as a user’s photo.

35.0

Yes

public static ConnectApi.Photo setPhoto(String communityId, String userId, String fileId, Integer versionNumber)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

userId

Type: String

ID for the context user or the keyword me.

fileId

Type: String

ID of an uploaded file. The file must be an image, and be smaller than 2 GB.

versionNumber

Type: Integer

Version number of the existing file. Specify either an existing version number, or null to get the latest version.

Type: ConnectApi.Photo

Photos are processed asynchronously and might not be visible right away.

Set a file that hasn’t been uploaded as a user’s photo.

35.0

Yes

public static ConnectApi.Photo setPhoto(String communityId, String userId, ConnectApi.BinaryInput fileUpload)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

userId

Type: String

ID for the context user or the keyword me.

fileUpload

Type: ConnectApi.Binary​​Input

File to use as the photo. The content type must be usable as an image.

Type: ConnectApi.Photo

Photos are processed asynchronously and might not be visible right away.

Set and crop an uploaded file as a user’s photo.

35.0

Yes

public static ConnectApi.Photo setPhotoWithAttributes(String communityId, String userId, ConnectApi.PhotoInput photo)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

userId

Type: String

ID for the context user or the keyword me.

photo

Type: ConnectApi.PhotoInput

A ConnectApi.PhotoInput object specifying the file ID, version number, and cropping parameters.

Type: ConnectApi.Photo

Photos are processed asynchronously and might not be visible right away.

Set and crop a file that hasn’t been uploaded as a user’s photo.

35.0

Yes

public static ConnectApi.Photo setPhotoWithAttributes(String communityId, String userId, ConnectApi.PhotoInput photo, ConnectApi.BinaryInput fileUpload)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

userId

Type: String

ID for the context user or the keyword me.

photo

Type: ConnectApi.PhotoInput

A ConnectApi.PhotoInput object specifying the cropping parameters.

fileUpload

Type: ConnectApi.Binary​​Input

File to use as the photo. The content type must be usable as an image.

Type: ConnectApi.Photo

Photos are processed asynchronously and might not be visible right away.