Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update API documentation #154

Merged
merged 2 commits into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 88 additions & 4 deletions docs/private-dns/api/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,99 @@ toc_max_heading_level: 4
https://api.adguard-dns.io/static/swagger/openapi.json to markdown using
https://swagger-markdown-ui.netlify.app/.

Changelog is from here:
https://api.adguard-dns.io/static/api/CHANGELOG.md

If you want to change it, ask the developers to change the OpenAPI spec.
-->

## AdGuard DNS API
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove these lines?

## AdGuard DNS API

DNS API documentation

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's auto-generated, any change here will make it much more complex to apply updates


DNS API documentation

## Version: 1.4
## AdGuard DNS API Change Log

### v1.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One could argue versions should go the other way around, from most recent to the oldest one

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also auto-generated


- Added authentication.
- CRUD operations with devices and DNS servers.
- Query log.
- Downloading DOT and DOT .mobileconfig.
- Filter Lists and Web-Services.

### v1.1

- Added methods to retrieve statistics by time, domains, companies and devices.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an empty line?

- Added method for updating device settings.
- Fixed required fields definition.

### v1.2

- Added new protocol types DNS and DNSCRYPT. Deprecating the PLAIN_TCP, PLAIN_UDP, DNSCRYPT_TCP and DNSCRYPT_UDP that will be removed later.

### v1.3

- Added method to get account limits.

### v1.4

- Added configurable option for blocking response: default (0.0.0.0), REFUSED, NXDOMAIN or custom IP-address.

### v1.5

- Added new setting `block_nrd` and group all security-related settings
to one place.

#### Model for safebrowsing settings changed from

``` json
{
"enabled": true
}
```

to:

``` json
{
"enabled": true,
"block_dangerous_domains": true,
"block_nrd": false
}
```

where `enabled` is now control all settings in group, `block_dangerous_domains` is previous model field "enabled" and `block_nrd` is settings for
filtering newly registered domains.

#### Model for saving server settings changed from

```json
{
"protection_enabled" : true,
"safebrowsing_enabled" : true,
...
}
```

to:

```json
{
"protection_enabled" : true,
"safebrowsing_settings" : {
"enabled": true,
"block_dangerous_domains": true,
"block_nrd": false
}
...
}
```

here new field `safebrowsing_settings` is used instead of deprecated `safebrowsing_enabled`, whose value
stored in `block_dangerous_domains`.

## Version: 1.5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changelog for v1.5 is already added above in this pull request, it's unclear what this "Version 1.5" means then


### /oapi/v1/account/limits

Expand Down Expand Up @@ -199,8 +284,7 @@ Lists DNS servers that belong to the user.

##### Description

Lists DNS servers that belong to the user. By default there is at least one
default server.
Lists DNS servers that belong to the user. By default there is at least one default server.

##### Responses

Expand Down Expand Up @@ -236,7 +320,7 @@ Removes a DNS server

##### Description

Removes a DNS server. All devices attached to this DNS server will be moved to the default DNS server. Deleting a default DNS server is forbidden.
Removes a DNS server. All devices attached to this DNS server will be moved to the default DNS server. Deleting the default DNS server is forbidden.

##### Parameters

Expand Down
Loading