Mastodon
  • 什么是 Mastodon?
  • 使用 Mastodon
    • 注册帐户
    • 设置你的个人资料
    • 在你的账户发布内容
    • 使用网络功能
    • 处理不想看到的内容
    • 推广你和他人
    • 进行偏好设置
    • 更多设置
    • 在站点外使用 Mastodon
    • 迁移或离开账户
    • 运行你自己的站点
  • 运营 Mastodon
    • 准备你的服务器
    • 从源代码安装
    • 配置你的环境
    • 安装可选功能
      • 对象存储
      • 洋葱服务
      • 验证码
      • 单点登录
    • 配置全文搜索
    • 设置你的新实例
    • 使用管理 CLI
    • 升级到新版本
    • 备份你的服务器
    • 迁移到新机器
    • 扩大你的站点规模
    • 审核操作
    • 故障排除
      • 数据库索引损坏
    • 用户组
  • 开发 Mastodon 应用
    • API 入门指南
    • 使用公开数据
    • 获取客户端应用访问权限
    • 使用帐户登录
    • 库与实现
  • 向 Mastodon 项目做贡献
    • 技术概览
    • 设置开发环境
    • 代码结构
    • 路由
    • 漏洞赏金与责任披露
  • 遵循的标准
    • ActivityPub
    • WebFinger
    • 安全性
    • Microformats
    • OAuth
    • Bearcaps
  • REST API
    • Datetime 格式
    • 指南与最佳实践
    • OAuth 令牌
    • OAuth 作用域
    • 速率限制
  • API 方法
    • apps
      • oauth
      • emails
    • accounts
      • bookmarks
      • favourites
      • mutes
      • blocks
      • domain_blocks
      • filters
      • reports
      • follow_requests
      • endorsements
      • featured_tags
      • preferences
      • followed_tags
      • suggestions
      • tags
    • profile
    • statuses
      • media
      • polls
      • scheduled_statuses
    • timelines
      • conversations
      • lists
      • markers
      • streaming
    • grouped notifications
    • notifications
      • push
    • search
    • instance
      • trends
      • directory
      • custom_emojis
      • announcements
    • admin
      • accounts
      • canonical_email_blocks
      • dimensions
      • domain_allows
      • domain_blocks
      • email_domain_blocks
      • ip_blocks
      • measures
      • reports
      • retention
      • trends
    • proofs
    • oembed
  • API 实体
    • Account
    • AccountWarning
    • Admin::Account
    • Admin::CanonicalEmailBlock
    • Admin::Cohort
    • Admin::Dimension
    • Admin::DomainAllow
    • Admin::DomainBlock
    • Admin::EmailDomainBlock
    • Admin::Ip
    • Admin::IpBlock
    • Admin::Measure
    • Admin::Report
    • Announcement
    • Appeal
    • Application
    • Context
    • Conversation
    • CustomEmoji
    • DomainBlock
    • Error
    • ExtendedDescription
    • FamiliarFollowers
    • FeaturedTag
    • Filter
    • FilterKeyword
    • FilterResult
    • FilterStatus
    • IdentityProof
    • Instance
    • List
    • Marker
    • MediaAttachment
    • Notification
    • NotificationPolicy
    • NotificationRequest
    • Poll
    • Preferences
    • PreviewCard
    • PreviewCardAuthor
    • PrivacyPolicy
    • Reaction
    • Relationship
    • RelationshipSeveranceEvent
    • Report
    • Role
    • Rule
    • ScheduledStatus
    • Search
    • Status
    • StatusEdit
    • StatusSource
    • Suggestion
    • Tag
    • TermsOfService
    • Token
    • Translation
    • V1::Filter
    • V1::Instance
    • V1::NotificationPolicy
    • WebPushSubscription

Application

表示一个通过 REST API 访问帐户或发布嘟文的应用。

    • 示例
    • 属性
      • name
      • website 可选
      • scopes
      • redirect_uris
      • redirect_uri 已弃用
      • vapid_key 已弃用
    • CredentialApplication 属性
      • client_id
      • client_secret
      • client_secret_expires_at
    • 参见

示例

{
  "name": "Test Application",
  "website": "https://app.example",
  "scopes": ["read", "write", "push"],
  "redirect_uri": "https://app.example/callback\nhttps://app.example/register",
  "redirect_uris": [
    "https://app.example/callback",
    "https://app.example/register"
  ]
}

属性

name

描述: 你的应用的名称。
类型: 字符串
版本历史:
0.9.9 - 添加

website 可选

描述: 与你的应用关联的网站。
类型: nullable 字符串 (URL)
版本历史:
0.9.9 - 添加
3.5.1 - this property is now nullable

scopes

描述: 你的应用的作用域。按空格分隔的已注册的 scopes 字符串。
类型: 字符串数组
版本历史:
4.3.0 - 添加

redirect_uris

描述: 你的应用的已注册重定向 URI。
类型: 字符串数组 (数组中元素的值为 URL 或 "urn:ietf:wg:oauth:2.0:oob")
版本历史:
4.3.0 - 添加

redirect_uri 已弃用

描述: 你的应用的已注册重定向 URI。
当注册了多个重定向 URI 时,可能包含 \n 字符。
类型: 字符串
版本历史:
0.0.0 - 添加
4.3.0 - 已弃用,推荐使用 redirect_uris,因为当注册了多个重定向 URI 时,此属性的值不是一个格式规范的 URI

vapid_key 已弃用

描述: 用于流式推送 API。与 POST /api/v1/apps 一同返回。等同于 WebPushSubscription#server_key 和 Instance#vapid_public_key
类型: 字符串
版本历史:
2.8.0 - 添加
4.3.0 - 已弃用,等待移除,请参阅 api/v2/instance 以获取此值 (configuration.vapid.public_key)

CredentialApplication 属性

所有 Application 属性以及以下属性:

client_id

描述: 客户端 ID 密钥,用于获取 OAuth 令牌
类型: 字符串
版本历史:
0.9.9 - 添加 4.3.0 - moved to CredentialApplication from Application

client_secret

描述: 客户端密钥,用于获取 OAuth 令牌
类型: 字符串
版本历史:
0.9.9 - 添加 4.3.0 - moved to CredentialApplication from Application

client_secret_expires_at

描述: 客户端密钥到期时间,目前始终返回 0,表示 OAuth 客户端不会过期
类型: 字符串
版本历史:
4.3.0 - 添加

参见

应用 API 方法
嘟文(application 属性)
app/serializers/rest/application_serializer.rb
app/serializers/rest/credential_application_serializer.rb

翻译状态: 本文是英文页面 Application 的翻译,最后翻译时间:2025-04-21,点击这里可以查看翻译后页面的改动。

最后更新于 April 21, 2025 · 改进此页面
也可在此找到: English

赞助商

Dotcom-Monitor LoadView Stephen Tures Swayable SponsorMotion

加入Mastodon · 博客 ·

查看源代码 · CC BY-SA 4.0 · 版权信息