REST API v4: POST senderdomains

This method is used to create a new senderdomain with the REST API. It uses an HTTP POST request to the following address:

https://api.copernica.com/v4/senderdomains

After a successful call the ID of the created senderdomain is returned.

Available parameters

Parameter Description
name The domain that you want to send emails with.
tracking (optional) The domain that you want to register impressions on.
bounces (optional) The domain that you want to register bounces on.

JSON example

The following JSON demonstrates how to use the API method:

{
    "name": "mysenderdomain.com",
    "tracking": "tracking.mysenderdomain.com",
    "bounces": "bounces.damian.nl"
}

PHP example

The following PHP script demonstrates how to use the API method:

// dependencies
require_once('copernica-rest-api.php');

// change this into your access token
$api = new CopernicaRestAPI("your-access-token", 4);

// data to be sent to the api
$data = array(
    'name'   =>  'mysenderdomain.com',
    'tracking'   =>  'tracking.mysenderdomain.com',
    'bounces'   =>  'bounces.mysenderdomain.com',
);

// do the call
$api->post("senderdomains", $data);

The example above requires the CopernicaRestApi class.

More information