Knowledgebase

Mark as Complaint

Method: PUT
Endpoint: /api/markAsComplaint/{id}

Parameters

Parameter Type Required

Description 

$id int Yes It refers to the contact ID, the status of which you want to turn to complaint/abuse. The contacts you mark as a complaint (abuse/spam) will no longer be able to receive emails from the system.


Response Parameters

Parameter Type Response
status string Success or Error


Example Request (CURL)

<?php
$id = 62;

$api_token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxx';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://sampledomain.com/api/markAsComplaint/$id");
//curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_HTTPHEADER,
    array('Content-Type: application/json', 'Authorization: Bearer ' . $api_token));
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
print_r($response);
curl_close($ch);
?>


Success Response

{"status":"success","result":"Success: Contact successfully Updated"}
Upon submitting a valid request with all correct parameters, there will be a success response.


Error Response

{"status":"error","result":"Error message goes here"}
For errors in the request, you will be returned a response with an Error status value and a short text-based message describing the nature of the error.
PUT
/api/markAsComplaint/{id}
Try it out