Skip to main content

Get User Activity

The getUserActivity() function is used to fetch the user activity. It takes a GetUserActivityRequest as input, which includes the user's UUID, page number, and page size. The function returns a GetUserActivityResponse as a Future.

Steps to Get User Activity

  1. Create an instance of GetUserActivityRequest using the GetUserActivityRequestBuilder class.
  2. Call the getUserActivity() function using the instance of the LMFeedClient class, passing the request as a parameter.
  3. Use the response as per your requirement.
final GetUserActivityRequest userActivityRequest = (GetUserActivityRequestBuilder()
..uuid('user_uuid')
..page(1)
..page(10))
.build();

// Get the response from calling the function
final GetUserActivityResponse userActivityResponse = await lmFeedClient.getUserActivity(userActivityRequest);

// Process the response, as per requirement
if(userActivityResponse.success){
// your function to handle successful retrieval of user activity
handleUserActivitySuccess();
}else{
// your function to handle error message
handleUserActivityError(userActivityResponse.errorMessage);
}

Models

GetUserActivityRequest

List of parameters for the GetUserActivityRequest class

VariableTypeDescriptionOptional
uuidStringUser's UUID
pageintPage number for pagination
pageSizeintNumber of items per page

GetUserActivityResponse

List of parameters for the GetUserActivityResponse class

VariableTypeDescriptionOptional
successboolAPI success status
errorMessageStringError message in case of failure
activitiesList<UserActivityItem>List of user activity items
usersMap<String, User>Map of user UUIDs to User entities
topicsMap<String, Topic>Map of topic IDs to Topic entities
widgetsMap<String, WidgetModel>Map of widget IDs to WidgetModel entities