Method: PUT
Endpoint: /api/updateFBLAccount/{id}
Parameter | Type | Required | Description |
id | integer | Yes | id of FBLaccount which you want to update |
string | No | Email of FBL account | |
hostname | string | No | Host of provider |
port | integer | No | Port to connect to the FBL account |
username | string | No | Username of FBL account |
method | pop, imap | No | Method to connect to the FBL account |
password | string | No | Password of FBL account |
folder | string (default : INBOX) | No | Folder name for your bounce account where complaint emails exist |
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 |
status | 0,1 (default: 0) | No | Status of bounce account 0 = Inctive 1 = Active |
encryption | none,ssl,tls | No | Encryption method for FBL 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/updateFBLAccount/';
//Bounce Rule Id
$fbl_id = 20;
$params = [
'email' => '[email protected]',
'password' => 'AXp145me]af',
'validate_certificates' => '0',
'username' => 'johnlee',
'port' => '1',
'host' => 'email.com',
'method' => 'ssl',
'delete_emails' => '0',
'response' => '1'
];
// Defining cURL Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$domain.$endpoint.$fbl_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: FBL Account has been successfully updated.",
"response": {
"id": 20,
"name": "[email protected]",
"host": "email.com",
"port": "1",
"username": "johnlee",
"password": "eyJpdiI6IlM3WWdVR21XZjhDZ3o1YzNaK1wvazVRPT0iLCJ2YWx1ZSI6ImZ3S0xzZXhQY2c2S28zK0pmTnRuTlcxc20rTHNSZHZNWkExYVA1R0VBTDg9IiwibWFjIjoiOGQ3OTExM2ZmZTFmMGRiM2VmZmFiYzk2MjE1NmJjMjY0ZTVlODAwMGQ3YmIwNDkyNmNiYmIzY2M3ZDdiMjYxYyJ9",
"folder": "INBOX",
"validate_certificates": "0",
"fbl_encryption": null,
"delete_emails": "0",
"processing_protocols": "ssl",
"user_id": 2,
"complaints": 0,
"status": "",
"error": null,
"created_at": "2020-10-12 12:21:09",
"updated_at": "2020-10-12 13:22:11"
}
}
Status value of the success response will be "success"
{
"status": "error",
"response": {
"email": [
"Error: Missing required parameter, email"
],
"host": [
"Error: Missing required parameter, host"
],
"port": [
"Error: Missing required parameter, port"
],
"username": [
"Error: Missing required parameter, username"
],
"method": [
"Error: Missing required parameter, method"
]
}
}