verifyTenant method

Future<Map<String, dynamic>?> verifyTenant({
  1. required String org,
  2. required String key,
})

Implementation

Future<Map<String, dynamic>?> verifyTenant({
  required String org,
  required String key,
}) async {
  var body = {
    'org': org,
    'key': key,
  };

  String formData = body.keys
      .map((key) =>
          "${Uri.encodeComponent(key)}=${Uri.encodeComponent(body[key].toString())}")
      .join("&");
  final response = await http.post(
    Uri.parse('$webbaseUrl/api/ibl/v1/tenant/validation/'),
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    body: formData,
  );

  var data = json.decode(response.body);

  return data; // Returns the API response
}