Подключение домена ссылок
curl --request POST \
--url https://api.erlcrussia.com/v3/teams/{teamId}/redirect-domains \
--header 'Content-Type: application/json' \
--header 'erlcrussia-api-key: <api-key>' \
--data '
{
"domain": "go.example.com",
"fallbackUrl": "https://example.com"
}
'import requests
url = "https://api.erlcrussia.com/v3/teams/{teamId}/redirect-domains"
payload = {
"domain": "go.example.com",
"fallbackUrl": "https://example.com"
}
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: 'go.example.com', fallbackUrl: 'https://example.com'})
};
fetch('https://api.erlcrussia.com/v3/teams/{teamId}/redirect-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/teams/{teamId}/redirect-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' => 'go.example.com',
'fallbackUrl' => 'https://example.com'
]),
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/teams/{teamId}/redirect-domains"
payload := strings.NewReader("{\n \"domain\": \"go.example.com\",\n \"fallbackUrl\": \"https://example.com\"\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/teams/{teamId}/redirect-domains")
.header("erlcrussia-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"domain\": \"go.example.com\",\n \"fallbackUrl\": \"https://example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.erlcrussia.com/v3/teams/{teamId}/redirect-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\": \"go.example.com\",\n \"fallbackUrl\": \"https://example.com\"\n}"
response = http.request(request)
puts response.read_body{
"id": "dom_4K9q",
"domain": "go.example.com",
"type": "redirect",
"fallbackUrl": "https://example.com",
"cfStatus": "pending",
"cfSslStatus": "initializing",
"ownershipName": "_cf-custom-hostname.go.example.com",
"ownershipValue": "8f3c2a1e-5b7d-4e9f-a1c3-2b4d6e8f0a1c",
"sslTxtName": "_acme-challenge.go.example.com",
"sslTxtValue": "Xy7Kq2LmZp9Wd4Rt",
"cnameVerified": false,
"isVerified": false,
"teamId": "team_7f3a",
"createdAt": "2026-10-21T12:00:00Z",
"updatedAt": "2026-10-21T12:00:00Z",
"verification": {
"cfStatus": "pending",
"cfSslStatus": "initializing",
"isVerified": false,
"cname": {
"name": "go.example.com",
"expected": "cname.erlcrussia.com",
"current": "",
"found": false
},
"ownershipVerification": {
"type": "txt",
"name": "_cf-custom-hostname.go.example.com",
"value": "8f3c2a1e-5b7d-4e9f-a1c3-2b4d6e8f0a1c"
},
"sslValidation": {
"type": "txt",
"txtName": "_acme-challenge.go.example.com",
"txtValue": "Xy7Kq2LmZp9Wd4Rt"
}
}
}Домены
Подключение домена ссылок
Подключает к команде домен для коротких ссылок.
POST
/
teams
/
{teamId}
/
redirect-domains
Подключение домена ссылок
curl --request POST \
--url https://api.erlcrussia.com/v3/teams/{teamId}/redirect-domains \
--header 'Content-Type: application/json' \
--header 'erlcrussia-api-key: <api-key>' \
--data '
{
"domain": "go.example.com",
"fallbackUrl": "https://example.com"
}
'import requests
url = "https://api.erlcrussia.com/v3/teams/{teamId}/redirect-domains"
payload = {
"domain": "go.example.com",
"fallbackUrl": "https://example.com"
}
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: 'go.example.com', fallbackUrl: 'https://example.com'})
};
fetch('https://api.erlcrussia.com/v3/teams/{teamId}/redirect-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/teams/{teamId}/redirect-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' => 'go.example.com',
'fallbackUrl' => 'https://example.com'
]),
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/teams/{teamId}/redirect-domains"
payload := strings.NewReader("{\n \"domain\": \"go.example.com\",\n \"fallbackUrl\": \"https://example.com\"\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/teams/{teamId}/redirect-domains")
.header("erlcrussia-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"domain\": \"go.example.com\",\n \"fallbackUrl\": \"https://example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.erlcrussia.com/v3/teams/{teamId}/redirect-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\": \"go.example.com\",\n \"fallbackUrl\": \"https://example.com\"\n}"
response = http.request(request)
puts response.read_body{
"id": "dom_4K9q",
"domain": "go.example.com",
"type": "redirect",
"fallbackUrl": "https://example.com",
"cfStatus": "pending",
"cfSslStatus": "initializing",
"ownershipName": "_cf-custom-hostname.go.example.com",
"ownershipValue": "8f3c2a1e-5b7d-4e9f-a1c3-2b4d6e8f0a1c",
"sslTxtName": "_acme-challenge.go.example.com",
"sslTxtValue": "Xy7Kq2LmZp9Wd4Rt",
"cnameVerified": false,
"isVerified": false,
"teamId": "team_7f3a",
"createdAt": "2026-10-21T12:00:00Z",
"updatedAt": "2026-10-21T12:00:00Z",
"verification": {
"cfStatus": "pending",
"cfSslStatus": "initializing",
"isVerified": false,
"cname": {
"name": "go.example.com",
"expected": "cname.erlcrussia.com",
"current": "",
"found": false
},
"ownershipVerification": {
"type": "txt",
"name": "_cf-custom-hostname.go.example.com",
"value": "8f3c2a1e-5b7d-4e9f-a1c3-2b4d6e8f0a1c"
},
"sslValidation": {
"type": "txt",
"txtName": "_acme-challenge.go.example.com",
"txtValue": "Xy7Kq2LmZp9Wd4Rt"
}
}
}Авторизации
Пользовательский API-ключ. Храните на сервере; не включайте в клиентский JavaScript.
Параметры пути
Постоянный ID организации; ключ должен быть привязан к этой организации.
Ответ
Успешный ответ.
Show child attributes
Show child attributes
Была ли эта страница полезной?