sendCommunicationCaptureRequest function
Future<Response>
sendCommunicationCaptureRequest(
- List<
CommunicationRequest> commRequest, - String token
Implementation
Future<http.Response> sendCommunicationCaptureRequest(
List<CommunicationRequest> commRequest,
String token,
) async {
Debug.print("CommunicationRequest: ${jsonEncode(commRequest)}");
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;
}