Create a record set
POST
/
cloud-dns
/
rrsets
Create a record set
curl --request POST \
--url https://api.aptranet.com/cloud-dns/rrsets \
--header 'Aptranet-Secret: <api-key>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "www",
"type": "A",
"ttl": 300,
"resource_records": [
{
"enabled": true,
"content": [
"192.0.2.10"
]
}
]
}
'import requests
url = "https://api.aptranet.com/cloud-dns/rrsets"
payload = {
"name": "www",
"type": "A",
"ttl": 300,
"resource_records": [
{
"enabled": True,
"content": ["192.0.2.10"]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Aptranet-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Aptranet-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'www',
type: 'A',
ttl: 300,
resource_records: [{enabled: true, content: ['192.0.2.10']}]
})
};
fetch('https://api.aptranet.com/cloud-dns/rrsets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aptranet.com/cloud-dns/rrsets"
payload := strings.NewReader("{\n \"name\": \"www\",\n \"type\": \"A\",\n \"ttl\": 300,\n \"resource_records\": [\n {\n \"enabled\": true,\n \"content\": [\n \"192.0.2.10\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Aptranet-Secret", "<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))
}{
"id": 2,
"warning": "<string>"
}{
"id": 2,
"warning": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}Authorizations
Access key beginning with APTRANET_.
Current secret paired with the access key.
Query Parameters
DNS zone identifier.
Required range:
x >= 1Body
application/json
Available options:
A, AAAA, CNAME, MX, TXT, NS, SRV, CAA, PTR, HTTPS, SVCB, DS Required range:
x >= 0Minimum array length:
1Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Create a record set
curl --request POST \
--url https://api.aptranet.com/cloud-dns/rrsets \
--header 'Aptranet-Secret: <api-key>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "www",
"type": "A",
"ttl": 300,
"resource_records": [
{
"enabled": true,
"content": [
"192.0.2.10"
]
}
]
}
'import requests
url = "https://api.aptranet.com/cloud-dns/rrsets"
payload = {
"name": "www",
"type": "A",
"ttl": 300,
"resource_records": [
{
"enabled": True,
"content": ["192.0.2.10"]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Aptranet-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Aptranet-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'www',
type: 'A',
ttl: 300,
resource_records: [{enabled: true, content: ['192.0.2.10']}]
})
};
fetch('https://api.aptranet.com/cloud-dns/rrsets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aptranet.com/cloud-dns/rrsets"
payload := strings.NewReader("{\n \"name\": \"www\",\n \"type\": \"A\",\n \"ttl\": 300,\n \"resource_records\": [\n {\n \"enabled\": true,\n \"content\": [\n \"192.0.2.10\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Aptranet-Secret", "<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))
}{
"id": 2,
"warning": "<string>"
}{
"id": 2,
"warning": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}