-
Notifications
You must be signed in to change notification settings - Fork 50
API Records
Lukas Metzger edited this page Mar 30, 2018
·
11 revisions
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, if ommited returns page 1 |
| pagesize | How many items should be on each page, if ommited page size is infinite therefore all results are returned |
| 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) |
| 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,
"domain": 1
}
]
}POST /records
{
"name": "dns.example.com",
"type": "A",
"content": "1.2.3.4",
"priority": 0,
"ttl": 86400,
"domain": 1
}| code | result |
|---|---|
| 201 | Everything was successful, record has been created |
| 400 | Given record type is not valid |
| 404 | Given domain does not exist or is not master or native |
| 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,
"domain": 1
}DELETE /records/{id}
| code | result |
|---|---|
| 204 | Everything was successful, the answer body is therefore empty |
| 404 | The given record id does not exist |
GET /record/{id}
| 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,
"domain": 1
}PUT /records/{id}
Not set properties will not be updated.
{
"name?": "dns.example.com",
"type?": "A",
"content?": "1.2.3.4",
"priority?": 0,
"ttl?": 86400
}| code | result |
|---|---|
| 204 | Everything was successful, the answer body is therefore empty |
| 400 | Given record type is not valid |
| 404 | The given domain id does not exist |