createSessionTokenFromTemplateWithHttpInfo method

Future<Response> createSessionTokenFromTemplateWithHttpInfo(
  1. String sessionId,
  2. String templateName, {
  3. CreateSessionTokenFromTemplateRequest? createSessionTokenFromTemplateRequest,
})

Create a session token from a jwt template

Creates a JSON Web Token(JWT) based on a session and a JWT Template name defined for your instance

Note: This method returns the HTTP Response.

Parameters:

Implementation

Future<http.Response> createSessionTokenFromTemplateWithHttpInfo(
  String sessionId,
  String templateName, {
  CreateSessionTokenFromTemplateRequest?
      createSessionTokenFromTemplateRequest,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/sessions/{session_id}/tokens/{template_name}'
      .replaceAll('{session_id}', sessionId)
      .replaceAll('{template_name}', templateName);

  // ignore: prefer_final_locals
  Object? postBody = createSessionTokenFromTemplateRequest;

  final queryParams = <QueryParam>[];
  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,
  );
}