Mastodon
  • Mastodonの使い方
    • Signing up for an account
    • Setting up your profile
    • Posting toots
    • Using the network features
    • Dealing with unwanted content
    • Promoting yourself and others
    • Set your preferences
    • その他の設定
    • Using Mastodon externally
    • Moving or leaving accounts
  • Mastodonの構築
    • マシンの準備
    • ソースからインストール
    • 環境設定
    • オプションのインストール
      • 全文検索
      • 秘匿サービス
      • シングルサインオン
    • セットアップを完了する
    • 開発者向けコマンドラインを利用する
    • 新しいバージョンへアップグレード
    • サーバのバックアップ
    • 新しいマシンへの移行
    • サーバーのスケールアップ
    • モデレーション
    • トラブルシューティング
  • アプリケーションの開発
    • Getting started with the API
    • Playing with public data
    • Obtaining client app access
    • ログイン
    • ガイドラインとベストプラクティス
    • ライブラリ等
  • コントリビューション
    • 技術的情報
    • 開発環境のセットアップ
    • ソースコードの構造
    • ルーティング
  • スペック
    • ActivityPub
    • WebFinger
    • Security
    • Microformats
    • OAuth
  • REST API
    • OAuthスコープ
  • API一覧
    • apps
      • oauth
    • accounts
      • bookmarks
      • favourites
      • mutes
      • blocks
      • domain_blocks
      • filters
      • reports
      • follow_requests
      • endorsements
      • featured_tags
      • preferences
      • suggestions
    • statuses
      • media
      • polls
      • scheduled_statuses
      • streaming
    • timelines
      • conversations
      • lists
      • markers
    • notifications
      • push
    • search
    • instance
      • trends
      • directory
      • custom_emojis
    • admin
    • proofs
    • oembed
  • APIエンティティ
    • Account
    • Activity
    • Admin::Account
    • Admin::Report
    • Application
    • Attachment
    • Card
    • Context
    • Conversation
    • Emoji
    • Error
    • FeaturedTag
    • Field
    • Filter
    • History
    • IdentityProof
    • Instance
    • List
    • Marker
    • Mention
    • Notification
    • Poll
    • Preferences
    • PushSubscription
    • Relationship
    • Report
    • Results
    • ScheduledStatus
    • Source
    • Status
    • Tag
    • Token

domain_blocks

ドメインブロックの追加と更新

get
Fetch domain blocks

https://mastodon.example/api/v1/domain_blocks

ユーザーがブロックしたドメイン

戻り値: 文字列の配列
OAuth: User token + read:blocks or follow
実装履歴:

  • 1.4.0 - 追加されました

リクエスト

ヘッダ
Authorization
必須
string
Bearer <user token>
クエリ
max_id
任意
string
**内的なパラメータです** ページングにはHTTPのリンクヘッダを参照してください。
since_id
任意
string
**内的なパラメータです** ページングにはHTTPのリンクヘッダを参照してください。
limit
任意
string
Maximum number of results to return per page. Defaults to 40. NOTE: Pagination is done with the Link header from the response. ページあたりの最大値。デフォルトは40です。ページ送りはLinkヘッダを見る必要があります。

レスポンス

200: Success

limit=2でのレスポンス例。block idはプライベートな情報であるため、ページ送りをするためにはHTTPのLinkヘッダーを見る必要があります。

Link: <https://mastodon.social/api/v1/domain_blocks?limit=2&max_id=16194>; rel="next", <https://mastodon.social/api/v1/domain_blocks?limit=2&since_id=16337>; rel="prev"

["nsfw.social","artalley.social"]

401: Unauthorized

Incorrect Authorization header

{
  "error": "The access token is invalid"
}

post
Block a domain

https://mastodon.example/api/v1/domain_blocks

ドメインブロックは:

  • そのドメインからの全ての公開投稿を隠します
  • そのドメインのユーザーからの全ての通知を隠します
  • そのドメインのユーザーからのフォローを解除します
  • そのドメインのユーザーはフォローできません(ただし既存のフォローは解除されません)

戻り値: n/a
OAuth: User token + ****write:blocks or follow
実装履歴:

  • 1.4.0 - 追加されました

リクエスト

ヘッダ
Authorization
必須
string
Bearer <user token>
フォームのパラメータ
domain
必須
string
ブロックするドメイン

レスポンス

200: Success

リクエストが成功した場合、空のオブジェクトが返ります。もしすでにそのドメインをブロックしていたり、そのようなドメインは存在しない、そもそもドメインの形でないような場合であっても「成功」とみなされることに注意してください。

{}

401: Unauthorized

誤ったAuthorizationヘッダ

{
  "error": "The access token is invalid"
}

422: Unprocessable Entity

If domain is not provided or contains spaces, the request will fail.

empty

{
  "error": "Validation failed: Domain can't be blank"
}
invalid
{
  "error": "Validation failed: Domain is not a valid domain name"
}

delete
Unblock a domain

https://mastodon.example/api/v1/domain_blocks

すでに存在しているドメインブロックを解除する。

戻り値: n/a
OAuth: User token + ****write:blocks or follow
実装履歴:

  • 1.4.0 - 追加されました

リクエスト

ヘッダ
Authorization
必須
string
Bearer <user token>
フォームのパラメータ
domain
必須
string
解除するドメイン

レスポンス

200: Success

リクエストが成功した場合、空のオブジェクトが返ります。もしそのドメインをブロックしていな買った場合でも、「成功」とみなされることに注意してください。

{}

401: Unauthorized

誤ったAuthorizationヘッダ

{
  "error": "The access token is invalid"
}

422: Unprocessable Entity

If domain is not provided or contains spaces, the request will fail.

empty

{
  "error": "Validation failed: Domain can't be blank"
}
invalid domain
{
  "error": "Validation failed: Domain is not a valid domain name"
}

最終更新 July 1, 2020 · このページを改善する
他の言語: English

Merch

Tシャツとステッカー(英語)

Mastodonに参加しよう · ブログ · ·

ソースコード · CC BY-SA 4.0 · インプリント