Chatter Class
Access information about followers and subscriptions for records.
These methods are for Chatter. All methods are static.
All methods in this class require Chatter and are subject to the per user, per namespace, per hour rate limit.
-
deleteSubscription(communityId, subscriptionId)
Delete a subscription. Use this method to stop following a record, a user, or a file.
-
getFollowers(communityId, recordId)
Get the first page of followers for a record.
-
getFollowers(communityId, recordId, pageParam, pageSize)
Get a page of followers for a record.
-
getSubscription(communityId, subscriptionId)
Get information about a subscription.
-
Submit a daily or weekly Chatter email digest job.
Delete a subscription. Use this method to stop following a record, a user, or a file.
28.0
Yes
public static void deleteSubscription(String communityId, String subscriptionId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- subscriptionId
Type: String
The ID for a subscription.
Type: Void
“Following” a user, group, or record is the same as “subscribing” to a user, group, or record. A “follower” is the user who followed the user, group, or record. A “subscription” is an object describing the relationship between the follower and the user, group, or record they followed.
To leave a group, call deleteMember(communityId, membershipId).
When you follow a user, the call to ConnectApi.ChatterUsers.follow returns a ConnectApi.Subscription object. To stop following the user, pass the id property of that object to this method.
See Also
Get the first page of followers for a record.
28.0
Yes
public static ConnectApi.FollowerPage getFollowers(String communityId, String recordId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- recordId
Type: String
ID for a record or the keyword
me.
Type: ConnectApi.FollowerPage
“Following” a user, group, or record is the same as “subscribing” to a user, group, or record. A “follower” is the user who followed the user, group, or record. A “subscription” is an object describing the relationship between the follower and the user, group, or record they followed.
See Also
Get a page of followers for a record.
28.0
Yes
public static ConnectApi.FollowerPage getFollowers(String communityId, String recordId, Integer pageParam, Integer pageSize)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- recordId
Type: String
ID for a record or the keyword
me.- pageParam
Type: Integer
Number of the page you want returned. Starts at 0. If you pass in
nullor 0, the first page is returned.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. If you pass in
null, the default size is 25.
Type: ConnectApi.FollowerPage
“Following” a user, group, or record is the same as “subscribing” to a user, group, or record. A “follower” is the user who followed the user, group, or record. A “subscription” is an object describing the relationship between the follower and the user, group, or record they followed.
See Also
Get information about a subscription.
28.0
Yes
public static ConnectApi.Subscription getSubscription(String communityId, String subscriptionId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- subscriptionId
Type: String
The ID for a subscription.
Type: ConnectApi.Subscription
“Following” a user, group, or record is the same as “subscribing” to a user, group, or record. A “follower” is the user who followed the user, group, or record. A “subscription” is an object describing the relationship between the follower and the user, group, or record they followed.
See Also
Submit a daily or weekly Chatter email digest job.
37.0
Yes
public static ConnectApi.DigestJobRepresentation submitDigestJob(ConnectApi.DigestPeriod period)
period
Type: ConnectApi.DigestPeriod
Time period that’s included in a Chatter email digest. Values are:
DailyDigest—The email includes up to the 50 latest posts from the previous day.WeeklyDigest—The email includes up to the 50 latest posts from the previous week.
Type: ConnectApi.DigestJob
The times when Chatter sends email digests are not configurable in the UI. To control when email digests are sent and to use this method, contact Salesforce to enable API-only Chatter Digests.
Enabling API-only Chatter Digests disables the scheduled digests for your org. You must call the API for your users to receive their digests.
We recommend scheduling digest jobs by implementing the Apex Schedulable interface with this method. To monitor your digest jobs from Setup, enter Background Jobs in the Quick Find box, then select Background Jobs.
Schedule daily digests:
Schedule weekly digests:
See Also