From 86eb63bcf5d423fb7f438870a639a6b131489546 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 5 Oct 2018 21:58:19 +0200 Subject: [PATCH] Add domain blocks API --- content/en/api/rest/domain-blocks.md | 52 ++++++++++++++++++++++++- layouts/shortcodes/api_method_info.html | 2 +- 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/content/en/api/rest/domain-blocks.md b/content/en/api/rest/domain-blocks.md index fdd0215..e5335d4 100644 --- a/content/en/api/rest/domain-blocks.md +++ b/content/en/api/rest/domain-blocks.md @@ -1,7 +1,55 @@ --- -title: Domain blocks API +title: Domain blocks menu: docs: - parent: api + parent: rest-api weight: 10 --- + +## GET /api/v1/domain_blocks + +Domains the user has blocked. + +Returns array of string. + +### Resource information + +{{< api_method_info auth="Yes" user="Yes" scope="read read:blocks follow" version="0.0.0" >}} + +### Parameters + +|Name|Description|Required|Default| +|----|-----------|:------:|:-----:| +| `limit` | Maximum number of results | Optional | 40 | + +### Pagination + +{{< api_pagination >}} + +## POST /api/v1/domain_blocks + +Block a domain to hide all public posts from it, all notifications from it, and remove all followers from it. + +### Resource information + +{{< api_method_info auth="Yes" user="Yes" scope="write write:blocks follow" version="0.0.0" >}} + +### Parameters + +|Name|Description|Required|Default| +|----|-----------|:------:|:-----:| +| `domain` | Domain to block| Required || + +## DELETE /api/v1/domain_blocks + +Remove a domain block. + +### Resource information + +{{< api_method_info auth="Yes" user="Yes" scope="write write:blocks follow" version="0.0.0" >}} + +### Parameters + +|Name|Description|Required|Default| +|----|-----------|:------:|:-----:| +| `domain` | Domain to block| Required || diff --git a/layouts/shortcodes/api_method_info.html b/layouts/shortcodes/api_method_info.html index 9dfc9ce..20d2fdb 100644 --- a/layouts/shortcodes/api_method_info.html +++ b/layouts/shortcodes/api_method_info.html @@ -18,7 +18,7 @@ {{ with .Get "scope" }} Scope - {{.}} + {{range split . " "}}{{ . }} {{ end }} {{ end }}