From cc626cfe12da34e0dac6615c77fc074b5bb718af Mon Sep 17 00:00:00 2001 From: Lukas Metzger Date: Fri, 5 Jan 2018 17:01:14 +0100 Subject: [PATCH] Updated API Records (markdown) --- API-Records.md | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/API-Records.md b/API-Records.md index b907b33..8f82ea7 100644 --- a/API-Records.md +++ b/API-Records.md @@ -36,3 +36,83 @@ ] } ``` + +## Create new record +`POST /records` + +### Body +```json +{ + "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 | + +```json +{ + "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 | + +```json +{ + "id": 21, + "name": "dns.example.com", + "type": "A", + "content": "1.2.3.4", + "priority": 0, + "ttl": 86400 +} +``` + +## Update record +`PUT /records/{id}` + +### Body +```json +{ + "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 | \ No newline at end of file