REST API v4: GET senderdomain
This method is used to fetch an existing senderdomain with the REST API. It uses an HTTP GET request to the following address:
https://api.copernica.com/v4/senderdomain/$id
Replace the $id
with the identifier of the senderdomain you want to fetch.
Returned parameters
Name | Description |
---|---|
ID | Unique numerical identifier of the senderdomain. |
domain | The domain that you are sending email with. |
approved | Whether the senderdomain is validated or not. |
records | A list with the different DNS records |
JSON voorbeeld
The JSON for the database might look something like this:
{
"ID": "113",
"domain": "https://mysenderdomain.com",
"approved": true,
"records": [{
"type": "dns",
"property": "validation",
"record": "TXT",
"name": "copernica-mysenderdomain.nl",
"value": "Q3YzYwMGI0ODNlYzUxMmE2ZWVhM2JjMDY1MTUwOGQ4OTZiNjhhMjgzMzQ1MGE1MWZkNjhiZDgwNwxx",
"actual": [],
"valid": "valid"
}, ...]
}
PHP example
The following example demonstrates how to use this method:
// dependencies
require_once("CopernicaRestAPI.php");
// change this into your access token
$api = new CopernicaRestAPI("your-access-token", 4);
// do the call, and print result
$api->get("senderdomain/{$id}");
The example above requires the CopernicaRestApi class.