Method: PUT
Endpoint: /api/updateBounceAddress/{id}
Parameter | Type | Required |
Description |
id | integer | Yes | id of bounce account which you want to update |
string | No | Email of bounce account | |
hostname | string | No | Host of provider |
port | integer | No | Port to connect to the bounce account |
username | string | No | Username of bounce account |
method | pop, imap | No | Method to connect to the bounce account |
password | string | No | Password of bounce account |
folder | string (default : INBOX) | No | Folder name for your bounce account where bounce email exists |
delete_emails | 0,1 (default: 0) | No | 0 = Do not delete proccessed emails 1 = Delete processed emails |
validate_certificates | 0,1 (default: 0) | No | 0 = Don not validate certificate 1 = Validate certificate |
process_bounces | 0,1 (default: 0) | No | 0 = Do not process bounce via bounce account 1 = Process bounce via bounce account |
is_active | 0,1 (default: 0) | No | Status of bounce account 0 = Inctive 1 = Active |
encryption | none,ssl,tls | No | Encryption method for bonce account |
response | 0, 1 (default: 0) | No | Get full response of the operation |
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/updateBounceAddress/';
//Bounce Account Id id
$bounce_id = 7;
$params = [
'email' => '[email protected]',
'hostname' => 'anydomain.com',
'port' => '110',
'username' => 'james',
'password' => 'secret',
'folder' => 'James',
'response' => '1'
];
// Defining cURL Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$domain.$endpoint.$bounce_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": "success",
"result": "Success: Bounce Address has been successfully updated.",
"response": {
"id": 7,
"process_bounce_report": 1,
"name": "[email protected]",
"host": "anydomain.com",
"port": 110,
"username": "james",
"password": "eyJpdiI6IlI5MmVBMGRoUFVaRkZLQTIyYTBJZGc9PSIsInZhbHVlIjoicHc2Z1dVbDlRUHRZS0QyQ3hmc2drdz09IiwibWFjIjoiMTU5NTMwYzU0MDI2ZjFhYTA1M2U3MjE2NWRiMmExZjBkYmFiNTkyYWRiNWRhNmM4YTliNWM4YTcyYmU5ODg1YiJ9",
"folder": "James",
"validate_certificates": 1,
"bounce_encryption": "ssl",
"delete_emails": 1,
"processing_protocols": "pop",
"user_id": 2,
"created_at": "2020-10-08 15:38:33",
"updated_at": "2020-10-09 10:34:29",
"has_error": 1
}
}
Status value of the success response will be "success"
{
"status": "error",
"result": {
"method": [
"Invalid method."
]
}
}