Skip to content

API Records

Lukas Metzger edited this page Jan 5, 2018 · 11 revisions

Domains

Get list of domains

GET /records?page=5&pagesize=10&domain=1,2,3,4&queryName=foo&type=NS,SRV,A&queryContent=bar&sort=id-asc,name-desc,type-asc,content-asc,priority-desc,ttl-asc

parameter explanation
page The page of the results to return
pagesize How many items should be on each page
domain A comma separated list of domain ids from which records should be returned, if omitted all records accessible by this user are returned
queryName A search query on the record name
type A comma separated list of record types (case insensitive)
queryContent A search query on the record content
sort A comma separated list of field names to sort (in this order) combined with the sort order (see example)

Response

code result
200 Everything was successful
{
  "paging": {
    "page": 5,
    "total": 20,
    "pagesize": 10
  },
  "results": [
    {
      "id": 1,
      "name": "dns.example.com",
      "type": "A",
      "content": "1.2.3.4",
      "priority": 0,
      "ttl": 86400
    }
  ]
}

Create new record

POST /records

Body

{
  "name": "dns.example.com",
  "type": "A",
  "content": "1.2.3.4",
  "priority": 0,
  "ttl": 86400
}

Response

code result
201 Everything was successful, domain has been created
422 One of the required fields is missing
{
  "id": 21,
  "name": "dns.example.com",
  "type": "A",
  "content": "1.2.3.4",
  "priority": 0,
  "ttl": 86400
}

Delete domain

DELETE /records/{id}

Response

code result
204 Everything was successful, the answer body is therefore empty
404 The given record id does not exist

Get single record

GET /record/{id}

Response

code result
200 Call was successful
404 The given record id does not exist
{
  "id": 21,
  "name": "dns.example.com",
  "type": "A",
  "content": "1.2.3.4",
  "priority": 0,
  "ttl": 86400
}

Update record

PUT /records/{id}

Body

{
  "name": "dns.example.com",
  "type": "A",
  "content": "1.2.3.4",
  "priority": 0,
  "ttl": 86400
}

Response

code result
204 Everything was successful, the answer body is therefore empty
404 The given domain id does not exist
422 One of the required fields is missing
Clone this wiki locally