getTopReactionsForUserWithHttpInfo method

Future<Response> getTopReactionsForUserWithHttpInfo(
  1. String userId,
  2. String timeRange, {
  3. int? page,
  4. int? perPage,
  5. String? teamId,
})

Get a list of the top reactions for a user.

Get a list of the top reactions across all public and private channels (the user is a member of) for a given user. If no team_id is provided, this will also include reactions posted by the given user in direct and group messages. ##### Permissions Must be logged in as the user.

Note: This method returns the HTTP Response.

Parameters:

  • String userId (required): User GUID

  • String timeRange (required): Time range can be "today", "7_day", or "28_day". - today: reactions posted on the current day. - 7_day: reactions posted in the last 7 days. - 28_day: reactions posted in the last 28 days.

  • int page: The page to select.

  • int perPage: The number of items per page, up to a maximum of 200.

  • String teamId: Team ID will scope the response to a given team and exclude direct and group messages. ##### Permissions Must have view_team permission for the team.

Implementation

Future<Response> getTopReactionsForUserWithHttpInfo(
  String userId,
  String timeRange, {
  int? page,
  int? perPage,
  String? teamId,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/users/me/top/reactions'.replaceAll('{user_id}', userId);

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <MmQueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  queryParams.addAll(_queryParams('', 'time_range', timeRange));
  if (page != null) {
    queryParams.addAll(_queryParams('', 'page', page));
  }
  if (perPage != null) {
    queryParams.addAll(_queryParams('', 'per_page', perPage));
  }
  if (teamId != null) {
    queryParams.addAll(_queryParams('', 'team_id', teamId));
  }

  const contentTypes = <String>[];

  return apiClient.invokeAPI(
    path,
    'GET',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}