Підключення CDN-домену
curl --request POST \
--url https://api.erlcrussia.com/v3/cdn/custom-domains \
--header 'Content-Type: application/json' \
--header 'erlcrussia-api-key: <api-key>' \
--data '
{
"domain": "files.example.com",
"s3Backup": true
}
'import requests
url = "https://api.erlcrussia.com/v3/cdn/custom-domains"
payload = {
"domain": "files.example.com",
"s3Backup": True
}
headers = {
"erlcrussia-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'erlcrussia-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({domain: 'files.example.com', s3Backup: true})
};
fetch('https://api.erlcrussia.com/v3/cdn/custom-domains', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.erlcrussia.com/v3/cdn/custom-domains",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'domain' => 'files.example.com',
's3Backup' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"erlcrussia-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.erlcrussia.com/v3/cdn/custom-domains"
payload := strings.NewReader("{\n \"domain\": \"files.example.com\",\n \"s3Backup\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("erlcrussia-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.erlcrussia.com/v3/cdn/custom-domains")
.header("erlcrussia-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"domain\": \"files.example.com\",\n \"s3Backup\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.erlcrussia.com/v3/cdn/custom-domains")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["erlcrussia-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"domain\": \"files.example.com\",\n \"s3Backup\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "dom_9Qx2",
"domain": "files.example.com",
"type": "cdn",
"originUrl": null,
"s3Backup": true,
"deployHookToken": "dht_5Zk8Lm2Qp7Xc",
"cfStatus": "pending",
"cfSslStatus": "initializing",
"ownershipName": "_cf-custom-hostname.files.example.com",
"ownershipValue": "8f3c2a1e-5b7d-4e9f-a1c3-2b4d6e8f0a1c",
"sslTxtName": "_acme-challenge.files.example.com",
"sslTxtValue": "Xy7Kq2LmZp9Wd4Rt",
"cnameVerified": false,
"isVerified": false,
"teamId": "team_7f3a",
"createdAt": "2026-10-21T12:00:00Z",
"updatedAt": "2026-10-21T12:00:00Z"
}Свої домени
Підключення CDN-домену
Підключає свій домен до CDN команди й повертає DNS-записи для перевірки.
POST
/
cdn
/
custom-domains
Підключення CDN-домену
curl --request POST \
--url https://api.erlcrussia.com/v3/cdn/custom-domains \
--header 'Content-Type: application/json' \
--header 'erlcrussia-api-key: <api-key>' \
--data '
{
"domain": "files.example.com",
"s3Backup": true
}
'import requests
url = "https://api.erlcrussia.com/v3/cdn/custom-domains"
payload = {
"domain": "files.example.com",
"s3Backup": True
}
headers = {
"erlcrussia-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'erlcrussia-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({domain: 'files.example.com', s3Backup: true})
};
fetch('https://api.erlcrussia.com/v3/cdn/custom-domains', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.erlcrussia.com/v3/cdn/custom-domains",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'domain' => 'files.example.com',
's3Backup' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"erlcrussia-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.erlcrussia.com/v3/cdn/custom-domains"
payload := strings.NewReader("{\n \"domain\": \"files.example.com\",\n \"s3Backup\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("erlcrussia-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.erlcrussia.com/v3/cdn/custom-domains")
.header("erlcrussia-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"domain\": \"files.example.com\",\n \"s3Backup\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.erlcrussia.com/v3/cdn/custom-domains")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["erlcrussia-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"domain\": \"files.example.com\",\n \"s3Backup\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "dom_9Qx2",
"domain": "files.example.com",
"type": "cdn",
"originUrl": null,
"s3Backup": true,
"deployHookToken": "dht_5Zk8Lm2Qp7Xc",
"cfStatus": "pending",
"cfSslStatus": "initializing",
"ownershipName": "_cf-custom-hostname.files.example.com",
"ownershipValue": "8f3c2a1e-5b7d-4e9f-a1c3-2b4d6e8f0a1c",
"sslTxtName": "_acme-challenge.files.example.com",
"sslTxtValue": "Xy7Kq2LmZp9Wd4Rt",
"cnameVerified": false,
"isVerified": false,
"teamId": "team_7f3a",
"createdAt": "2026-10-21T12:00:00Z",
"updatedAt": "2026-10-21T12:00:00Z"
}Авторизації
Користувальницький API-ключ. Зберігайте на сервері; не включайте у клієнтський JavaScript.
Відповідь
Успішна відповідь.
Чи була ця сторінка корисною?