Method: PUT
Endpoint: /api/updateBounceRule/{id}
Parameter | Type | Required |
Description |
id | integer | Yes | id of bounce rule which you want to update |
label | string | No | Label for bounce rule |
code | string | No | Bounce Code i.e (5.1.1) |
code_condition | is | No | is = where bounce code is |
type | no_process,hard,soft | No | Action to mark as bounce no_process = not bounced hard = hard bounced soft = soft bounces |
reason | string | No | Bounce reason |
reason_condition | is, contains | Yes if reason is set | is = where bounce reason is contains = where reason contains specfic character(s) |
details | string | No | Bounce details |
details_condition | is , contains | Yes if reason is set | is = where bounce details is contains = where bounce details contains specfic character(s) |
details_reason | string | No | Bounce detailed reason |
reason_condition | is, contains | Yes if details_reason is set | is = where bounce details_reason is contains = where bounce details_reason contains specfic character(s) |
status | 0, 1 (Default: 1) | No | 0 = Inactive 1 = Active |
Parameter | Type | Description |
status | JSON | Success or Error |
result | JSON | Result of the operation |
response | JSON | Output of the operation |
<?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/updateBounceRule/';
//Bounce Rule Id
$bounce_rule_id = 365;
$params = [
'label' => '5.1.1 label',
'code' => '5.1.1',
'response' => '1'
];
// Defining cURL Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$domain.$endpoint.$bounce_rule_id);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_HTTPHEADER,
array('Content-Type: application/json', 'Authorization: Bearer ' . $api_token));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Executing cURL
$output = curl_exec ($ch);
// Printing Output
echo "<pre>";
echo json_encode(json_decode($output),JSON_PRETTY_PRINT );
// Closing cURL
curl_close ($ch);
?>
{
"status": true,
"result": "Success: Bounce Rule has been successfully updated.",
"response": {
"id": 365,
"label": "5.1.1 label",
"code": "5.1.1",
"code_condition": "is",
"reason": null,
"details_condition": null,
"reason_condition": null,
"details": null,
"type": "hard",
"status": 1,
"is_default": 0,
"sort_order": null,
"user_id": 2,
"created_at": "2020-10-09 14:27:58",
"updated_at": "2020-10-12 08:43:51"
}
}
Status value of the success response will be "success"
{
"status": "error",
"result": {
"details_condition": [
"Invalid details condition."
]
}
}