getTokenWithHttpInfo method

Future<Response> getTokenWithHttpInfo(
  1. String userId,
  2. String key, {
  3. int? tokenValidity,
})

Request a new temporary token for authentication

Note: This method returns the HTTP Response.

Parameters:

  • String userId (required):

  • String key (required): The token key. Only one instance of a token with a defined key can exist at the same time

  • int tokenValidity: The token validity in seconds

Implementation

Future<Response> getTokenWithHttpInfo(String userId, String key, { int? tokenValidity, }) async {
  // ignore: prefer_const_declarations
  final path = r'/rest/v1/user/token/{userId}/{key}'.replaceAll('{userId}', userId).replaceAll('{key}', key);

  // ignore: prefer_final_locals
  Object? postBody;

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

  if (tokenValidity != null) {
    queryParams.addAll(_queryParams('', 'tokenValidity', tokenValidity));
  }

  const authNames = <String>[r'basicSchema'];
  const contentTypes = <String>[];


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