batchLookupUserUname method

Future<BatchLookupUserUnameResponse> batchLookupUserUname({
  1. required String networkId,
  2. required List<String> unames,
  3. String? clientToken,
})

Looks up multiple user usernames from their unique username hashes (unames). This operation allows you to retrieve the email addresses associated with a list of username hashes.

May throw BadRequestError. May throw ForbiddenError. May throw InternalServerError. May throw RateLimitError. May throw ResourceNotFoundError. May throw UnauthorizedError. May throw ValidationError.

Parameter networkId : The ID of the Wickr network where the users will be looked up.

Parameter unames : A list of username hashes (unames) to look up. Each uname is a unique identifier for a user's username. Maximum 50 unames per batch request.

Parameter clientToken : A unique identifier for this request to ensure idempotency.

Implementation

Future<BatchLookupUserUnameResponse> batchLookupUserUname({
  required String networkId,
  required List<String> unames,
  String? clientToken,
}) async {
  final headers = <String, String>{
    if (clientToken != null) 'X-Client-Token': clientToken.toString(),
  };
  final $payload = <String, dynamic>{
    'unames': unames,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/networks/${Uri.encodeComponent(networkId)}/users/uname-lookup',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return BatchLookupUserUnameResponse.fromJson(response);
}