Method: GET
Endpoint: /api/getSuppressed
Parameter
Parameter |
Type |
Required |
Description |
type |
email, ip, domain |
Yes |
Select type of suppression list you want to get |
id |
int |
No |
id of the suppressed entry |
reference |
string |
No |
Get suppressed records according to this reference |
user_id |
int |
No |
Get suppressed records of a particular user |
limit_start |
int (default: 0) |
No |
Starting row of result. Default: 0 |
limit_count |
int (default: 25) |
No |
Number of records to get. Default: 25 |
Response Parameters
Parameter |
Type |
Description |
status |
JSON |
Success or Error |
result |
JSON |
Result of the operation |
response |
JSON |
Output of the operation |
Example Request (CURL)
<?php
// Authentication
$api_token = 'API_KEY'; // Mumara API Key (can be found in Settings -> API Key)
$domain = 'http://www.anydomain.com'; // Your Mumara Domain Name
// API Endpoint
$endpoint = '/api/getSuppressed';
//parameters
$data = array (
'type' => 'email',
'reference' => 'added via api',
'limit_start' => '0',
'limit_count' => '1',
);
$params = '';
foreach($data as $key=>$value)
$params .= $key.'='.$value.'&';
$params = trim($params, '&');
$params = str_replace(" ","%20",$params);
// Defining cURL Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$domain.$endpoint.'?'.$params);
curl_setopt($ch, CURLOPT_HTTPHEADER,
array('Content-Type: application/json', 'Authorization: Bearer ' . $api_token));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// Executing cURL
$output = curl_exec ($ch);
// Printing Output
echo "<pre>";
echo json_encode(json_decode($output),JSON_PRETTY_PRINT );
// Closing cURL
curl_close ($ch);
?>
Example Response (JSON)
{
"status": "error",
"result": [
{
"id": 3,
"label": "added via api",
"email": "[email protected]",
"list_id": 2,
"is_suppressed": 1,
"user_id": 2,
"created_at": "2019-05-16 07:13:22",
"updated_at": "2019-05-16 07:13:22"
},
{
"id": 4,
"label": "added via api",
"email": "[email protected]",
"list_id": 2,
"is_suppressed": 1,
"user_id": 2,
"created_at": "2019-05-16 07:14:18",
"updated_at": "2019-05-16 07:14:18"
}
]
}
Status value of the success response will be "Success"
Example Error Response (JSON)
{
"status": "error",
"result": "Error: Records do not exist."
}
Possible Errors
- Invalid format
- Access Denied