getUserAccessTokensForUserWithHttpInfo method

Future<Response> getUserAccessTokensForUserWithHttpInfo(
  1. String userId, {
  2. int? page,
  3. int? perPage,
})

Get user access tokens

Get a list of user access tokens for a user. Does not include the actual authentication tokens. Use query parameters for paging. Minimum server version: 4.1 ##### Permissions Must have read_user_access_token permission. For non-self requests, must also have the edit_other_users permission.

Note: This method returns the HTTP Response.

Parameters:

  • String userId (required): User GUID

  • int page: The page to select.

  • int perPage: The number of tokens per page.

Implementation

Future<Response> getUserAccessTokensForUserWithHttpInfo(
  String userId, {
  int? page,
  int? perPage,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/users/{user_id}/tokens'.replaceAll('{user_id}', userId);

  // ignore: prefer_final_locals
  Object? postBody;

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

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

  const contentTypes = <String>[];

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