Knowledgebase

Add Bounce Address

Method: POST
Endpoint: /api/addBounceAddress

Parameters

Parameter Type Required Description 
email string Yes Email of bounce account
hostname string Yes Host of provider 
port integer Yes Port to connect to the bounce account
username string Yes Username of bounce account
method pop, imap Yes 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
Response Parameters

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/addBounceAddress';

$params = [
            'email'     			=> '[email protected]',
            'hostname'    			=> 'anydomain.com',
            'port'    				=> '110',
            'username'   			=> 'james',
            'method'                => 'pop',
            'delete_emails'         => '1',
            'validate_certificates' => '1',
            'process_bounces'       => '1',
            'is_active'             => '1',
            'encryption'            => 'tls',
            'password'              => 'secret',
            'folder'                => 'James',
            'response'              => '1'
];

// Defining cURL Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$domain.$endpoint);
curl_setopt($ch, CURLOPT_POST, true);
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);
?>

 

Example Response (JSON)

{
    "status": "success",
    "result": "Success: Bounce Address has been successfully added.",
    "response": {
        "id": 9,
        "process_bounce_report": 1,
        "name": "[email protected]",
        "host": "anydomain.com",
        "port": 110,
        "username": "james",
        "password": "eyJpdiI6ImtDQU1GRXFwQWxyS0JBeUF1alpFTUE9PSIsInZhbHVlIjoiN3hIekpJc3lENDlFTkJwZmpDRWpsZz09IiwibWFjIjoiMjZjY2I4OGU2MjRiNjJmODNhMjg2OTZhNDg2OTAzMjVlMjU2YWZjOGMwN2RlY2ZlMzAzYjA2N2YxOTRmNmNmNyJ9",
        "folder": "James",
        "validate_certificates": 1,
        "bounce_encryption": "tls",
        "delete_emails": 1,
        "processing_protocols": "pop",
        "user_id": 2,
        "created_at": "2020-10-09 07:23:57",
        "updated_at": "2020-10-09 07:23:57",
        "has_error": 0
    }
}
Status value of the success response will be "success"

 

Example Error Response (JSON)

 {
    "status": "error",
    "result": {
    "method": [
        "Invalid method."
      ]
    }
 }

 

Possible Errors

  • Bounce address already exists.
  • Invalid hostname
  • Missing required parameters
  • Invalid methos
POST
/api/addBounceAddress
Try it out