getUser method

Future<User?> getUser(
  1. String apiKey,
  2. String customerId,
  3. String externalUserId
)

Implementation

Future<User?> getUser(
  String apiKey,
  String customerId,
  String externalUserId,
) async {
  try {
    final result = await dio.get(
      '${Config.url}/users/$externalUserId?useExternal=true',
      options: Options(
        headers: {
          'Content-Type': 'application/json',
          'Accept': 'application/json',
          "x-api-key": apiKey,
          "x-customer": customerId,
        },
      ),
    );

    return User.fromJson(result.data);
  } catch (e) {
    return null;
  }
}