CommunityModeration Class

Access information about flagged feed items and comments in a community. Add and remove flags from comments and feed items.

Namespace

ConnectApi

CommunityModeration Methods

The following are methods for CommunityModeration. All methods are static.

addFlagToComment(communityId, commentId)

Add a moderation flag to a comment.

API Version

29.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationFlags addFlagToComment(String communityId, String commentId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
commentId
Type: String
The ID for a comment.

Return Value

Type: ConnectApi.​ModerationFlags

Usage

To add a flag to a comment, Allow members to flag content must be selected for a community.

addFlagToComment(communityId, commentId, visibility)

Add a moderation flag of the specified visibility to a comment.

API Version

30.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationFlags addFlagToComment(String communityId, String commentId, ConnectApi.CommunityFlagVisibility visibility)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
commentId
Type: String
The ID for a comment.
visibility
Type: ConnectApi.​CommunityFlag​Visibility
Visibility behavior of a flag for various user types.
  • ModeratorsOnly—The flag is visible only to users with moderation permissions on the flagged element or item.
  • SelfAndModerators—The flag is visible to the creator of the flag and to users with moderation permissions on the flagged element or item.

Return Value

Type: ConnectApi.​ModerationFlags

Usage

To add a flag to a comment, Allow members to flag content must be selected for a community.

addFlagToComment(communityId, commentId, type)

Add a moderation flag of the specified type to a comment.

API Version

38.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationFlags addFlagToComment(String communityId, String commentId, ConnectApi.CommunityFlagType type)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
commentId
Type: String
The ID for a comment.
type
Type: ConnectApi.CommunityFlagType
Type of moderation flag.
  • FlagAsInappropriate—Flag for inappropriate content.
  • FlagAsSpam—Flag for spam.

If a type isn’t specified, it defaults to FlagAsInappropriate.

Return Value

Type: ConnectApi.​ModerationFlags

Usage

To add a flag to a comment, Allow members to flag content must be selected for a community.

addFlagToComment(communityId, commentId, note)

Add a moderation flag with a note to a comment.

API Version

38.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationFlags addFlagToComment(String communityId, String commentId, String note)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
commentId
Type: String
The ID for a comment.
note
Type: String
A note of up to 4,000 characters about the flag.

Return Value

Type: ConnectApi.​ModerationFlags

Usage

To add a flag to a comment, Allow members to flag content must be selected for a community.

addFlagToComment(communityId, commentId, type, note)

Add a moderation flag of the specified type with a note to a comment.

API Version

38.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationFlags addFlagToComment(String communityId, String commentId, ConnectApi.CommunityFlagType type, String note)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
commentId
Type: String
The ID for a comment.
type
Type: ConnectApi.CommunityFlagType
Type of moderation flag.
  • FlagAsInappropriate—Flag for inappropriate content.
  • FlagAsSpam—Flag for spam.

If a type isn’t specified, it defaults to FlagAsInappropriate.

note
Type: String
A note of up to 4,000 characters about the flag.

Return Value

Type: ConnectApi.​ModerationFlags

Usage

To add a flag to a comment, Allow members to flag content must be selected for a community.

addFlagToComment(communityId, commentId, type, visibility)

Add a moderation flag of the specified type and visibility to a comment.

API Version

38.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationFlags addFlagToComment(String communityId, String commentId, ConnectApi.CommunityFlagType type, ConnectApi.CommunityFlagVisibility visibility)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
commentId
Type: String
The ID for a comment.
type
Type: ConnectApi.CommunityFlagType
Type of moderation flag.
  • FlagAsInappropriate—Flag for inappropriate content.
  • FlagAsSpam—Flag for spam.

If a type isn’t specified, it defaults to FlagAsInappropriate.

visibility
Type: ConnectApi.​CommunityFlag​Visibility
Visibility behavior of a flag for various user types.
  • ModeratorsOnly—The flag is visible only to users with moderation permissions on the flagged element or item.
  • SelfAndModerators—The flag is visible to the creator of the flag and to users with moderation permissions on the flagged element or item.

Return Value

Type: ConnectApi.​ModerationFlags

Usage

To add a flag to a comment, Allow members to flag content must be selected for a community.

addFlagToComment(communityId, commentId, visibility, note)

Add a moderation flag of the specified visibility with a note to a comment.

API Version

38.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationFlags addFlagToComment(String communityId, String commentId, ConnectApi.CommunityFlagVisibility visibility, String note)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
commentId
Type: String
The ID for a comment.
visibility
Type: ConnectApi.​CommunityFlag​Visibility
Visibility behavior of a flag for various user types.
  • ModeratorsOnly—The flag is visible only to users with moderation permissions on the flagged element or item.
  • SelfAndModerators—The flag is visible to the creator of the flag and to users with moderation permissions on the flagged element or item.
note
Type: String
A note of up to 4,000 characters about the flag.

Return Value

Type: ConnectApi.​ModerationFlags

Usage

To add a flag to a comment, Allow members to flag content must be selected for a community.

addFlagToComment(communityId, commentId, type, visibility, note)

Add a moderation flag of the specified type and visibility with a note to a comment.

API Version

38.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationFlags addFlagToComment(String communityId, String commentId, ConnectApi.CommunityFlagType type, ConnectApi.CommunityFlagVisibility visibility, String note)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
commentId
Type: String
The ID for a comment.
type
Type: ConnectApi.CommunityFlagType
Type of moderation flag.
  • FlagAsInappropriate—Flag for inappropriate content.
  • FlagAsSpam—Flag for spam.

If a type isn’t specified, it defaults to FlagAsInappropriate.

visibility
Type: ConnectApi.​CommunityFlag​Visibility
Visibility behavior of a flag for various user types.
  • ModeratorsOnly—The flag is visible only to users with moderation permissions on the flagged element or item.
  • SelfAndModerators—The flag is visible to the creator of the flag and to users with moderation permissions on the flagged element or item.
note
Type: String
A note of up to 4,000 characters about the flag.

Return Value

Type: ConnectApi.​ModerationFlags

Usage

To add a flag to a comment, Allow members to flag content must be selected for a community.

addFlagToFeedElement(communityId, feedElementId)

Add a moderation flag to a feed element.

API Version

31.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationCapability addFlagToFeedElement(String communityId, String feedElementId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
ID of the feed element.

Return Value

Type: ConnectApi.ModerationCapability

If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.

Usage

To add a flag to a feed element, Allow members to flag content must be selected for a community.

addFlagToFeedElement(communityId, feedElementId, visibility)

Add a moderation flag of the specified visibility to a feed element.

API Version

31.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationCapability addFlagToFeedElement(String communityId, String feedElementId, ConnectApi.CommunityFlagVisibility visibility)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
ID of the feed element.
visibility
Type: ConnectApi.CommunityFlagVisibility
Visibility behavior of a flag for various user types. One of these values:
  • ModeratorsOnly—The flag is visible only to users with moderation permissions on the flagged element or item.
  • SelfAndModerators—The flag is visible to the creator of the flag and to users with moderation permissions on the flagged element or item.

Return Value

Type: ConnectApi.ModerationCapability

If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.

Usage

To add a flag to a feed element, Allow members to flag content must be selected for a community.

addFlagToFeedElement(communityId, feedElementId, type)

Add a moderation flag of the specified type to a feed element.

API Version

38.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationCapability addFlagToFeedElement(String communityId, String feedElementId, ConnectApi.CommunityFlagType type)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
ID of the feed element.
type
Type: ConnectApi.CommunityFlagType
Type of moderation flag.
  • FlagAsInappropriate—Flag for inappropriate content.
  • FlagAsSpam—Flag for spam.

If a type isn’t specified, it defaults to FlagAsInappropriate.

Return Value

Type: ConnectApi.ModerationCapability

Usage

To add a flag to a feed element, Allow members to flag content must be selected for a community.

addFlagToFeedElement(communityId, feedElementId, note)

Add a moderation flag with a note to a feed element.

API Version

38.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationCapability addFlagToFeedElement(String communityId, String feedElementId, String note)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
ID of the feed element.
note
Type: String
A note of up to 4,000 characters about the flag.

Return Value

Type: ConnectApi.ModerationCapability

Usage

To add a flag to a feed element, Allow members to flag content must be selected for a community.

addFlagToFeedElement(communityId, feedElementId, type, note)

Add a moderation flag of the specified type with a note to a feed element.

API Version

38.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationCapability addFlagToFeedElement(String communityId, String feedElementId, ConnectApi.CommunityFlagType type, String note)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
ID of the feed element.
type
Type: ConnectApi.CommunityFlagType
Type of moderation flag.
  • FlagAsInappropriate—Flag for inappropriate content.
  • FlagAsSpam—Flag for spam.

If a type isn’t specified, it defaults to FlagAsInappropriate.

note
Type: String
A note of up to 4,000 characters about the flag.

Return Value

Type: ConnectApi.ModerationCapability

Usage

To add a flag to a feed element, Allow members to flag content must be selected for a community.

addFlagToFeedElement(communityId, feedElementId, type, visibility)

Add a moderation flag of the specified type and visibility to a feed element.

API Version

38.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationCapability addFlagToFeedElement(String communityId, String feedElementId, ConnectApi.CommunityFlagType type, ConnectApi.CommunityFlagVisibility visibility)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
ID of the feed element.
type
Type: ConnectApi.CommunityFlagType
Type of moderation flag.
  • FlagAsInappropriate—Flag for inappropriate content.
  • FlagAsSpam—Flag for spam.

If a type isn’t specified, it defaults to FlagAsInappropriate.

visibility
Type: ConnectApi.CommunityFlagVisibility
Visibility behavior of a flag for various user types. One of these values:
  • ModeratorsOnly—The flag is visible only to users with moderation permissions on the flagged element or item.
  • SelfAndModerators—The flag is visible to the creator of the flag and to users with moderation permissions on the flagged element or item.

Return Value

Type: ConnectApi.ModerationCapability

Usage

To add a flag to a feed element, Allow members to flag content must be selected for a community.

addFlagToFeedElement(communityId, feedElementId, visibility, note)

Add a moderation flag of the specified visibility with a note to a feed element.

API Version

38.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationCapability addFlagToFeedElement(String communityId, String feedElementId, ConnectApi.CommunityFlagVisibility visibility, String note)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
ID of the feed element.
visibility
Type: ConnectApi.CommunityFlagVisibility
Visibility behavior of a flag for various user types. One of these values:
  • ModeratorsOnly—The flag is visible only to users with moderation permissions on the flagged element or item.
  • SelfAndModerators—The flag is visible to the creator of the flag and to users with moderation permissions on the flagged element or item.
note
Type: String
A note of up to 4,000 characters about the flag.

Return Value

Type: ConnectApi.ModerationCapability

Usage

To add a flag to a feed element, Allow members to flag content must be selected for a community.

addFlagToFeedElement(communityId, feedElementId, type, visibility, note)

Add a moderation flag of the specified type and visibility with a note to a feed element.

API Version

38.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationCapability addFlagToFeedElement(String communityId, String feedElementId, ConnectApi.CommunityFlagType type, ConnectApi.CommunityFlagVisibility visibility, String note)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
ID of the feed element.
type
Type: ConnectApi.CommunityFlagType
Type of moderation flag.
  • FlagAsInappropriate—Flag for inappropriate content.
  • FlagAsSpam—Flag for spam.

If a type isn’t specified, it defaults to FlagAsInappropriate.

visibility
Type: ConnectApi.CommunityFlagVisibility
Visibility behavior of a flag for various user types. One of these values:
  • ModeratorsOnly—The flag is visible only to users with moderation permissions on the flagged element or item.
  • SelfAndModerators—The flag is visible to the creator of the flag and to users with moderation permissions on the flagged element or item.
note
Type: String
A note of up to 4,000 characters about the flag.

Return Value

Type: ConnectApi.ModerationCapability

Usage

To add a flag to a feed element, Allow members to flag content must be selected for a community.

getFlagsOnComment(communityId, commentId)

Get the moderation flags on a comment.

API Version

29.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationFlags getFlagsOnComment(String communityId, String commentId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
commentId
Type: String
The ID for a comment.

Return Value

Type: ConnectApi.​ModerationFlags

Usage

To get moderation flags, the context user must have the Moderate Communities Feeds permission.

getFlagsOnComment(communityId, commentId, visibility)

Get the moderation flags with specified visibility on a comment.

API Version

30.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationFlags getFlagsOnComment(String communityId, String commentId, ConnectApi.CommunityFlagVisibility visibility)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
commentId
Type: String
The ID for a comment.
visibility
Type: ConnectApi.​CommunityFlag​Visibility
Visibility behavior of a flag for various user types.
  • ModeratorsOnly—The flag is visible only to users with moderation permissions on the flagged element or item.
  • SelfAndModerators—The flag is visible to the creator of the flag and to users with moderation permissions on the flagged element or item.

Return Value

Type: ConnectApi.​ModerationFlags

Usage

To get moderation flags, the context user must have the Moderate Communities Feeds permission.

getFlagsOnComment(communityId, commentId, pageSize, pageParam)

Get a page of moderation flags on a comment.

API Version

40.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationFlags getFlagsOnComment(String communityId, String commentId, Integer pageSize, String pageParam)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
commentId
Type: String
The ID for a comment.
pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. The default size is 0.
pageParam
Type: String
The page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.

Return Value

Type: ConnectApi.​ModerationFlags

Usage

To get moderation flags, the context user must have the Moderate Communities Feeds permission.

getFlagsOnComment(communityId, commentId, visibility, pageSize, pageParam)

Get a page of moderation flags with specified visibility on a comment.

API Version

40.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationFlags getFlagsOnComment(String communityId, String commentId, ConnectApi.CommunityFlagVisibility visibility, Integer pageSize, String pageParam)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
commentId
Type: String
The ID for a comment.
visibility
Type: ConnectApi.​CommunityFlag​Visibility
Visibility behavior of a flag for various user types.
  • ModeratorsOnly—The flag is visible only to users with moderation permissions on the flagged element or item.
  • SelfAndModerators—The flag is visible to the creator of the flag and to users with moderation permissions on the flagged element or item.
pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. The default size is 0.
pageParam
Type: String
The page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.

Return Value

Type: ConnectApi.​ModerationFlags

Usage

To get moderation flags, the context user must have the Moderate Communities Feeds permission.

getFlagsOnFeedElement(communityId, feedElementId)

Get the moderation flags on a feed element.

API Version

31.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationCapability getFlagsOnFeedElement(String communityId, String feedElementId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
ID of the feed element.

Return Value

Type: ConnectApi.​Moderation​Capability Class

If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.

Usage

To get moderation flags, the context user must have the Moderate Communities Feeds permission.

getFlagsOnFeedElement(communityId, feedElementId, visibility)

Get the moderation flags with specified visibility on a feed element.

API Version

31.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationCapability getFlagsOnFeedElement(String communityId, String feedElementId, ConnectApi.CommunityFlagVisibility visibility)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
ID of the feed element.
visibility
Type: ConnectApi.CommunityFlagVisibility
Visibility behavior of a flag for various user types. One of these values:
  • ModeratorsOnly—The flag is visible only to users with moderation permissions on the flagged element or item.
  • SelfAndModerators—The flag is visible to the creator of the flag and to users with moderation permissions on the flagged element or item.

Return Value

Type: ConnectApi.​Moderation​Capability Class

If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.

Usage

To get moderation flags, the context user must have the Moderate Communities Feeds permission.

getFlagsOnFeedElement(communityId, feedElementId, pageParam, pageSize)

Get a page of moderation flags on a feed element.

API Version

40.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationCapability getFlagsOnFeedElement(String communityId, String feedElementId, String pageParam, Integer pageSize)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
ID of the feed element.
pageParam
Type: String
The page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. The default size is 0.

Return Value

Type: ConnectApi.​Moderation​Capability Class

If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.

Usage

To get moderation flags, the context user must have the Moderate Communities Feeds permission.

getFlagsOnFeedElement(communityId, feedElementId, visibility, pageSize, pageParam)

Get a page of moderation flags with specified visibility on a feed element.

API Version

40.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationCapability getFlagsOnFeedElement(String communityId, String feedElementId, ConnectApi.CommunityFlagVisibility visibility, Integer pageSize, String pageParam)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
ID of the feed element.
visibility
Type: ConnectApi.​CommunityFlag​Visibility
Visibility behavior of a flag for various user types.
  • ModeratorsOnly—The flag is visible only to users with moderation permissions on the flagged element or item.
  • SelfAndModerators—The flag is visible to the creator of the flag and to users with moderation permissions on the flagged element or item.
pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. The default size is 0.
pageParam
Type: String
The page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.

Return Value

Type: ConnectApi.​Moderation​Capability Class

If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.

Usage

To get moderation flags, the context user must have the Moderate Communities Feeds permission.

removeFlagFromComment(communityId, commentId, userId)

Remove a moderation flag from a comment.

API Version

29.0

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationFlags removeFlagFromComment(String communityId, String commentId, String userId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
commentId
Type: String
The ID for a comment.
userId
Type: String
The ID for a user.

Return Value

Type: Void

Usage

To remove a moderation flag, the context user must have added the flag or must have the Moderate Communities Feeds permission.

removeFlagFromFeedElement(communityId, feedElementId, userId)

Remove a moderation flag from a feed element.

API Version

31.0

Requires Chatter

Yes

Signature

public static void removeFlagFromFeedElement(String communityId, String feedElementId, String userId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
ID of the feed element.
userId
Type: String
The ID for a user.

Return Value

Type: ConnectApi.​Moderation​Capability Class

If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.

Usage

To remove a moderation flag, the context user must have added the flag or must have the Moderate Communities Feeds permission.

Retired CommunityModeration Methods

The following methods for CommunityModeration are retired.

addFlagToFeedItem(communityId, feedItemId)

Add a moderation flag to a feed item.

API Version

29.0–31.0
Important

Important

In version 32.0 and later, use addFlagToFeedElement(communityId, feedElementId).

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationFlags addFlagToFeedItem(String communityId, String feedItemId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedItemId
Type: String
The ID for a feed item.

Return Value

Type: ConnectApi.​ModerationFlags

Usage

To add a flag to a feed item, Allow members to flag content must be selected for a community.

addFlagToFeedItem(communityId, feedItemId, visibility)

Add a moderation flag with specified visibility to a feed item.

API Version

30.0–31.0
Important

Important

In version 32.0 and later, use addFlagToFeedElement(communityId, feedElementId, visibility).

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationFlags addFlagToFeedItem(String communityId, String feedItemId, ConnectApi.CommunityFlagVisibility visibility)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedItemId
Type: String
The ID for a feed item.
visibility
Type: ConnectApi.​CommunityFlag​Visibility
Visibility behavior of a flag for various user types.
  • ModeratorsOnly—The flag is visible only to users with moderation permissions on the flagged element or item.
  • SelfAndModerators—The flag is visible to the creator of the flag and to users with moderation permissions on the flagged element or item.

Return Value

Type: ConnectApi.​ModerationFlags

Usage

To add a flag to a feed item, Allow members to flag content must be selected for a community.

getFlagsOnFeedItem(communityId, feedItemId)

Get the moderation flags on a feed item.

API Version

29.0–31.0
Important

Important

In version 32.0 and later, use getFlagsOnFeedElement(communityId, feedElementId).

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationFlags getFlagsOnFeedItem(String communityId, String feedItemId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedItemId
Type: String
The ID for a feed item.

Return Value

Type: ConnectApi.​ModerationFlags

Usage

To get moderation flags, the context user must have the Moderate Communities Feeds permission.

getFlagsOnFeedItem(communityId, feedItemId, visibility)

Get the moderation flags with specified visibility on a feed item.

API Version

30.0–31.0
Important

Important

In version 32.0 and later, use getFlagsOnFeedElement(communityId, feedElementId, visibility).

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationFlags getFlagsOnFeedItem(String communityId, String feedItemId, ConnectApi.CommunityFlagVisibility visibility)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedItemId
Type: String
The ID for a feed item.
visibility
Type: ConnectApi.​CommunityFlag​Visibility
Visibility behavior of a flag for various user types.
  • ModeratorsOnly—The flag is visible only to users with moderation permissions on the flagged element or item.
  • SelfAndModerators—The flag is visible to the creator of the flag and to users with moderation permissions on the flagged element or item.

Return Value

Type: ConnectApi.​ModerationFlags

Usage

To get moderation flags, the context user must have the Moderate Communities Feeds permission.

removeFlagsOnFeedItem(communityId, feedItemId, userId)

Remove a moderation flag from a feed item.

API Version

29.0–31.0
Important

Important

In version 32.0 and later, use removeFlagFromFeedElement(communityId, feedElementId, userId).

Requires Chatter

Yes

Signature

public static ConnectApi.ModerationFlags removeFlagsOnFeedItem(String communityId, String feedItemId, String userId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedItemId
Type: String
The ID for a feed item.
userId
Type: String
The ID for a user.

Return Value

Type: Void

Usage

To remove a moderation flag, the context user must have added the flag or must have the Moderate Communities Feeds permission.