createUserAccessTokenWithHttpInfo method

Future<Response> createUserAccessTokenWithHttpInfo(
  1. String userId,
  2. MmCreateUserAccessTokenRequest mmCreateUserAccessTokenRequest
)

Create a user access token

Generate a user access token that can be used to authenticate with the Mattermost REST API. Minimum server version: 4.1 ##### Permissions Must have create_user_access_token permission. For non-self requests, must also have the edit_other_users permission.

Note: This method returns the HTTP Response.

Parameters:

Implementation

Future<Response> createUserAccessTokenWithHttpInfo(
  String userId,
  MmCreateUserAccessTokenRequest mmCreateUserAccessTokenRequest,
) async {
  // ignore: prefer_const_declarations
  final path = r'/users/{user_id}/tokens'.replaceAll('{user_id}', userId);

  // ignore: prefer_final_locals
  Object? postBody = mmCreateUserAccessTokenRequest;

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

  const contentTypes = <String>['application/json'];

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