Updated API Records (markdown)
parent
cd48ee3ba1
commit
cc626cfe12
|
@ -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 |
|
Loading…
Reference in a new issue