Set downstream address
const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({records: [{priority: 1, weight: 1, port: 1, target: '<string>'}]})
};
fetch('https://api.mailchannels.net/inbound/v1/domains/{domain}/downstream-address', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.mailchannels.net/inbound/v1/domains/{domain}/downstream-address"
payload = { "records": [
{
"priority": 1,
"weight": 1,
"port": 1,
"target": "<string>"
}
] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mailchannels.net/inbound/v1/domains/{domain}/downstream-address",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'records' => [
[
'priority' => 1,
'weight' => 1,
'port' => 1,
'target' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request PUT \
--url https://api.mailchannels.net/inbound/v1/domains/{domain}/downstream-address \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"records": [
{
"priority": 1,
"weight": 1,
"port": 1,
"target": "<string>"
}
]
}
'{
"records": [
{
"priority": 1,
"weight": 1,
"port": 1,
"target": "<string>"
}
]
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}Set downstream address
Sets the list of downstream addreses for the domain. This action deletes any existing downstream address for the domain before creating new ones. If the ‘records’ parameter is an empty array, all downstream address records will be deleted.
PUT
/
domains
/
{domain}
/
downstream-address
Set downstream address
const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({records: [{priority: 1, weight: 1, port: 1, target: '<string>'}]})
};
fetch('https://api.mailchannels.net/inbound/v1/domains/{domain}/downstream-address', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.mailchannels.net/inbound/v1/domains/{domain}/downstream-address"
payload = { "records": [
{
"priority": 1,
"weight": 1,
"port": 1,
"target": "<string>"
}
] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mailchannels.net/inbound/v1/domains/{domain}/downstream-address",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'records' => [
[
'priority' => 1,
'weight' => 1,
'port' => 1,
'target' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request PUT \
--url https://api.mailchannels.net/inbound/v1/domains/{domain}/downstream-address \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"records": [
{
"priority": 1,
"weight": 1,
"port": 1,
"target": "<string>"
}
]
}
'{
"records": [
{
"priority": 1,
"weight": 1,
"port": 1,
"target": "<string>"
}
]
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}Authorizations
Path Parameters
The domain name.
Body
application/json
Maximum array length:
10Show child attributes
Show child attributes
Response
The list of downstream addresses was set to be the list submitted with the request.
Show child attributes
Show child attributes
Was this page helpful?
⌘I

