Notification
表示与用户相关的事件通知。
属性
id
描述: 数据库中通知的 ID。
类型: 字符串 (从整数转换而来,但不保证是一个数字)
版本历史:
0.9.9 - 添加
type
描述: 导致通知的事件类型。
类型: 字符串 (可枚举 oneOf)mention = 有人在他们的嘟文中提到了你status = 你启用了发嘟通知的用户发布了嘟文reblog = 有人转发了你的一条嘟文follow = 有人关注了你follow_request = 有人请求关注你favourite = 有人喜欢了你的一条嘟文poll = 你投票或创建的投票已结束update = 你转发的嘟文已被编辑admin.sign_up = 有人注册了(可选择发送给管理员)admin.report = 有新的举报被提交severed_relationships = 由于管理或屏蔽事件,你的一些关注关系已被切断moderation_warning = 管理员已对你的帐户采取了行动或向你发送了警告
版本历史:
0.9.9 - 添加
2.8.0 - 添加 poll
3.1.0 - 添加 follow_request
3.3.0 - 添加 status
3.5.0 - 添加 update and admin.sign_up
4.0.0 - 添加 admin.report
4.3.0 - 添加 severed_relationships and moderation_warning
group_key
描述: 类似通知共享的群组键,用于分组通知功能。应被视为不透明,但可以假定未分组的通知具有 group_key 形式 ungrouped-{notification_id}。
类型: 字符串
版本历史:
4.3.0 - 添加
created_at
描述: 通知的时间戳。
类型: (Datetime) 字符串
版本历史:
0.9.9 - 添加
account
描述: 执行了生成通知的操作的帐户。
类型: Account
版本历史:
0.9.9 - 添加
status 可选
描述: 作为通知对象的嘟文。当通知的 type 为 favourite、reblog、status、mention、poll 或 update 时附加。
类型: Status
版本历史:
0.9.9 - 添加
report 可选
描述: 作为通知对象的举报。当通知的 type 为 admin.report 时附加。
类型: Report
版本历史:
4.0.0 - 添加
event 可选
描述: 导致关注关系中断的事件摘要。当通知的 type 为 severed_relationships 时附加。
类型: RelationshipSeveranceEvent
版本历史:
4.3.0 - 添加
moderation_warning 可选
描述: 导致通知的管理警告。当通知的 type 为 moderation_warning 时附加。
类型: AccountWarning
版本历史:
4.3.0 - 添加
示例
Mention
{
"id": "34975861",
"type": "mention",
"created_at": "2019-11-23T07:49:02.064Z",
"account": {
"id": "971724",
"username": "zsc",
"acct": "zsc",
// ...
},
"status": {
"id": "103186126728896492",
"created_at": "2019-11-23T07:49:01.940Z",
"in_reply_to_id": "103186038209478945",
"in_reply_to_account_id": "14715",
// ...
}
}
Favourite
{
"id": "34975535",
"type": "favourite",
"created_at": "2019-11-23T07:29:18.903Z",
"account": {
"id": "297420",
"username": "haskal",
"acct": "haskal@cybre.space",
// ...
},
"status": {
"id": "103186046267791694",
"created_at": "2019-11-23T07:28:34.210Z",
// ...
"account": {
"id": "14715",
"username": "trwnh",
"acct": "trwnh",
// ...
},
// ...
}
}
另请参考
notifications API 方法 app/serializers/rest/notification_serializer.rb翻译状态: 本文是英文页面 Notification 的翻译,最后翻译时间:2025-04-21,点击这里可以查看翻译后页面的改动。