sendCommunicationCaptureRequest function

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

Implementation

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