createApiKey method

Future<Map<String, dynamic>> createApiKey(
  1. String userId,
  2. String description, {
  3. String? expiresIn,
  4. bool? refresh,
})

Creates a new API key for a user.

Implementation

Future<Map<String, dynamic>> createApiKey(String userId, String description,
    {String? expiresIn, bool? refresh}) async {
  final response = await kuzzle.query(KuzzleRequest(
      controller: name,
      action: 'createApiKey',
      userId: userId,
      body: <String, dynamic>{
        'description': description,
      },
      waitForRefresh: refresh,
      expiresIn: expiresIn));

  return response.result as Map<String, dynamic>;
}