Email

Email

GET /{applianceId}/system/mail

Get mail SMTP settings for Appliance

Path parameters
applianceId string Required

The id of the cluster node the request is for.

curl
curl -X GET "https://appliance.example.com/api/v1/{applianceId}/system/mail" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/{applianceId}/system/mail';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/{applianceId}/system/mail", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/{applianceId}/system/mail', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "SMTP Relay",
  "data": [
    {
      "username": "",
      "password": ""
    }
  ]
}

PUT /{applianceId}/system/mail

Update mail SMTP setting for Appliance

This change is staged. Send PUT /services/apply to apply it.

Path parameters
applianceId string Required

.Body parameters

address object Required
username string Required
password string Required
curl
curl -X PUT "https://appliance.example.com/api/v1/{applianceId}/system/mail" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "address": {},
  "username": "<username>",
  "password": "<password>"
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/{applianceId}/system/mail';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'address' => [],
    'username' => '<username>',
    'password' => '<password>',
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode($payload),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}
payload = {
    "address": {},
    "username": "<username>",
    "password": "<password>"
}

response = requests.put("https://appliance.example.com/api/v1/{applianceId}/system/mail", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/{applianceId}/system/mail', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "address": {},
  "username": "<username>",
  "password": "<password>"
}),
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "SMTP Relay setting updated"
}