Knowledgebase

Delete Sending Domain

Method: DELETE
Endpoint: /api/deleteSendingDomain/{id}

Parameters

Parameter Type Required

Description 

id integer Yes Id of sending domain which you want to delete


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

//user id
$domain_id = 24;

// Defining cURL Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$domain.$endpoint.$domain_id);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
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": "User has been successfully deleted."
}
Status value of the success response will be "success"

 

Example Error Response (JSON)

 {
    "status": "error",
    "result": "The domain you are trying to delete is currently attached to the following assets. Before you can delete this sending domain, you`ll need to move connected assets to any other sending domain.",
    "response": {
        "connected_assets": {
            "lists": [
                "https://campaigns.adnan.dev.jt.hostingshouse.com/list/123/edit"
            ],
            "web_forms": [
                "https://campaigns.adnan.dev.jt.hostingshouse.com/form/12/edit"
            ],
            "triggers": [
                "https://campaigns.adnan.dev.jt.hostingshouse.com/trigger/15/edit"
            ],
            "nodes": [
                "https://campaigns.adnan.dev.jt.hostingshouse.com/node/sparkpost/21/edit",
                "https://campaigns.adnan.dev.jt.hostingshouse.com/node/smtp2go/22/edit"
            ]
        }
    }
 }

 

Possible Errors

  • Error: Record doesn`t exist
DELETE
/api/deleteSendingDomain/{id}
Try it out