Knowledgebase

Mark as Complaint

Following API will be used If you are looking to mark certain contact as complaint/abuse through an application or custom code.

Required Parameters to Submit Request

Method (PUT)

Endpoint URL: http://www.mydomain.com/api/markAsComplaint/{id}

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
response string Result of the operation


Example Request (CURL)

<?php
$id = 62;
$params = [
    'is_spamed' => 1,
];
$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","response":"Success: Contact successfully Updated"}
Upon submitting a valid request with all correct parameters, there will be a success response.


Error Response

{"status":"error","response":"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