removeFromCampaign method
Implementation
Future<http.Response> removeFromCampaign(
String campaignId, String contactId) async {
final url =
'${mauticBaseUrl!}/api/campaigns/$campaignId/contact/$contactId/remove';
final headers = getHeaders();
final response = await httpClient.post(
Uri.parse(url),
headers: headers,
);
if (response.statusCode != 200) {
throw Exception(
'Failed to remove user from campaign: ${response.statusCode}');
}
return jsonDecode(response.body);
}