Skip to main content

Get Reports

To fetch reports related to posts, comments, and other entities, use the getReports function. This function retrieves reported content for moderation.

Steps to Get Reports

  1. Use the getReports() function provided by the lmFeedClient object.
  2. Create an instance of GetReportsRequest, as shown in the snippet, and pass it to the above method.
  3. Use the response as per your requirement.
import GetReportsRequest from "../requests/getReportsRequest";

try {
const getReportsRequest = GetReportsRequest.builder()
.setPage(pageNumber) // Page number to fetch
.setPageSize(pageSize) // Number of items per page
.setFilterType(filterTypes) // Types of filters to apply
.setIsClosed(isClosed) // Whether to fetch closed reports
.build();
const response = await lmFeedClient.getReports(getReportsRequest);
// Use the response as per your requirement.
} catch (error) {
// Handle the error as per your requirement.
}

Models

GetReportsRequest

VARIABLETYPEDESCRIPTIONOPTIONAL
pagenumberPage number for pagination
pageSizenumberNumber of items per page
filterTypeFilterType[]Types of filters to apply
isClosedbooleanWhether to fetch closed reports

GetReportsResponse

VARIABLETYPEDESCRIPTIONOPTIONAL
reportsReport[]List of reports
postsRecord<string, Post>Map of post objects
usersRecord<string, User>Map of user objects
repostedPostsRecord<string, Post>Map of reposted posts
topicsRecord<string, Topic>Map of topics
userTopicsRecord<string, Topic>Map of user topics
widgetsRecord<string, Widget>Map of widgets
commentsRecord<string, Comment>Map of comments

FilterType

VARIABLEVALUE
POSTpost
COMMENTcomment
REPLYreply
PENDING_POSTpending_post