sendCommunicationCaptureRequest function

Future<Response> sendCommunicationCaptureRequest(
  1. List<CommunicationRequest> commRequest,
  2. String token
)

Implementation

Future<http.Response> sendCommunicationCaptureRequest(
  List<CommunicationRequest> commRequest,
  String token,
) async {
  final uniqueId = await PerceptFlutterPlatform.instance.getUniqueID();
  final headers = authHeaders(token, uniqueId);
  final body = jsonEncode({'events': commRequest});
  final request = http.post(
    Uri.parse(sendCommunicationCaptureUrl),
    headers: headers,
    body: body,
  );
  final response = await request;
  Debug.print("Communication capture Response: ${response.body}");
  return response;
}