Newer Version Available
CommunityModeration Class
Namespace
CommunityModeration Methods
The following are methods for CommunityModeration. All methods are static.
addFlagToComment(communityId, commentId)
API Version
29.0
Requires Chatter
Yes
Signature
public static ConnectApi.ModerationFlags addFlagToComment(String communityId, String commentId)
Parameters
Return Value
addFlagToComment(communityId, commentId, visibility)
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.CommunityFlagVisibility
-
Specifies the 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
addFlagToFeedElement(communityId, feedElementId)
API Version
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.ModerationCapability addFlagToFeedElement(String communityId, String feedElementId)
Parameters
Return Value
Type: ConnectApi.ModerationCapability Class
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
addFlagToFeedElement(communityId, feedElementId, visibility)
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
- The ID for a feed element.
- visibility
- Type: ConnectApi.CommunityFlagVisibility
-
Specifies the 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 Class
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
addFlagToFeedItem(communityId, feedItemId)
API Version
Requires Chatter
Yes
Signature
public static ConnectApi.ModerationFlags addFlagToFeedItem(String communityId, String feedItemId)
Parameters
Return Value
addFlagToFeedItem(communityId, feedItemId, visibility)
API Version
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.CommunityFlagVisibility
-
Specifies the 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
getFlagsOnComment(communityId, commentId)
API Version
29.0
Requires Chatter
Yes
Signature
public static ConnectApi.ModerationFlags getFlagsOnComment(String communityId, String commentId)
Parameters
Return Value
getFlagsOnComment(communityId, commentId, visibility)
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.CommunityFlagVisibility
-
Specifies the 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
getFlagsOnFeedElement(communityId, feedElementId)
API Version
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.ModerationCapability getFlagsOnFeedElement(String communityId, String feedElementId)
Parameters
Return Value
Type: ConnectApi.ModerationCapability Class
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
getFlagsOnFeedElement(communityId, feedElementId, visibility)
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
- The ID for a feed element.
- visibility
- Type: ConnectApi.CommunityFlagVisibility
-
Specifies the 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 Class
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
getFlagsOnFeedItem(communityId, feedItemId)
API Version
Requires Chatter
Yes
Signature
public static ConnectApi.ModerationFlags getFlagsOnFeedItem(String communityId, String feedItemId)
Parameters
Return Value
getFlagsOnFeedItem(communityId, feedItemId, visibility)
API Version
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.CommunityFlagVisibility
-
Specifies the 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
removeFlagFromComment(communityId, commentId, userId)
API Version
29.0
Requires Chatter
Yes
Signature
public static ConnectApi.ModerationFlags removeFlagFromComment(String communityId, String commentId, String userId)
Parameters
Return Value
Type: Void
removeFlagFromFeedElement(communityId, feedElementId, userId)
API Version
31.0
Requires Chatter
Yes
Signature
public static void removeFlagFromFeedElement(String communityId, String feedElementId, String userId)
Parameters
Return Value
Type: ConnectApi.ModerationCapability Class
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
removeFlagsOnFeedItem(communityId, feedItemId, userId)
API Version
Requires Chatter
Yes
Signature
public static ConnectApi.ModerationFlags removeFlagsOnFeedItem(String communityId, String feedItemId, String userId)
Parameters
Return Value
Type: Void