i have approximate knowledge of many things. perpetual student. (nb/ace/they)
xmpp/email: a@trwnh.com
https://trwnh.com
help me live: https://liberapay.com/at or https://paypal.me/trwnh
- my triggers are moths and glitter
- i have all notifs except mentions turned off, so please interact if you wanna be friends! i literally will not notice otherwise
- dm me if i did something wrong, so i can improve
- purest person on fedi, do not lewd in my presence
- #1 ami cole fan account
:fatyoshi:
", "url": "https://mastodon.social/@trwnh", "avatar": "https://files.mastodon.social/accounts/avatars/000/014/715/original/34aa222f4ae2e0a9.png", "avatar_static": "https://files.mastodon.social/accounts/avatars/000/014/715/original/34aa222f4ae2e0a9.png", "header": "https://files.mastodon.social/accounts/headers/000/014/715/original/5c6fc24edb3bb873.jpg", "header_static": "https://files.mastodon.social/accounts/headers/000/014/715/original/5c6fc24edb3bb873.jpg", "followers_count": 821, "following_count": 178, "statuses_count": 33120, "last_status_at": "2019-11-24T15:49:42.251Z", "source": { "privacy": "public", "sensitive": false, "language": "", "note": "i have approximate knowledge of many things. perpetual student. (nb/ace/they)\r\n\r\nxmpp/email: a@trwnh.com\r\nhttps://trwnh.com\r\nhelp me live: https://liberapay.com/at or https://paypal.me/trwnh\r\n\r\n- my triggers are moths and glitter\r\n- i have all notifs except mentions turned off, so please interact if you wanna be friends! i literally will not notice otherwise\r\n- dm me if i did something wrong, so i can improve\r\n- purest person on fedi, do not lewd in my presence\r\n- #1 ami cole fan account\r\n\r\n:fatyoshi:", "fields": [ { "name": "Website", "value": "https://trwnh.com", "verified_at": "2019-08-29T04:14:55.571+00:00" }, { "name": "Sponsor", "value": "https://liberapay.com/at", "verified_at": "2019-11-15T10:06:15.557+00:00" }, { "name": "Fan of:", "value": "Punk-rock and post-hardcore (Circa Survive, letlive., La Dispute, THE FEVER 333)Manga (Yu-Gi-Oh!, One Piece, JoJo's Bizarre Adventure, Death Note, Shaman King)Platformers and RPGs (Banjo-Kazooie, Boktai, Final Fantasy Crystal Chronicles)", "verified_at": null }, { "name": "Main topics:", "value": "systemic analysis, design patterns, anticapitalism, info/tech freedom, theory and philosophy, and otherwise being a genuine and decent wholesome poster. i'm just here to hang out and talk to cool people!", "verified_at": null } ], "follow_requests_count": 0 }, "emojis": [ { "shortcode": "fatyoshi", "url": "https://files.mastodon.social/custom_emojis/images/000/023/920/original/e57ecb623faa0dc9.png", "static_url": "https://files.mastodon.social/custom_emojis/images/000/023/920/static/e57ecb623faa0dc9.png", "visible_in_picker": true } ], "fields": [ { "name": "Website", "value": "https://trwnh.com", "verified_at": "2019-08-29T04:14:55.571+00:00" }, { "name": "Sponsor", "value": "https://liberapay.com/at", "verified_at": "2019-11-15T10:06:15.557+00:00" }, { "name": "Fan of:", "value": "Punk-rock and post-hardcore (Circa Survive, letlive., La Dispute, THE FEVER 333)Manga (Yu-Gi-Oh!, One Piece, JoJo's Bizarre Adventure, Death Note, Shaman King)Platformers and RPGs (Banjo-Kazooie, Boktai, Final Fantasy Crystal Chronicles)", "verified_at": null }, { "name": "Main topics:", "value": "systemic analysis, design patterns, anticapitalism, info/tech freedom, theory and philosophy, and otherwise being a genuine and decent wholesome poster. i'm just here to hang out and talk to cool people!", "verified_at": null } ] } ``` ##### 401: Unauthorized 若令牌无效或不正确,凭据验证将失败。 ```json { "error": "The access token is invalid" } ``` ##### 403: Forbidden 你的用户账户当前已禁用,缺少已验证的电子邮件地址或正在等待批准。 ```json { "error": "Your login is currently disabled" } ``` ```json { "error": "Your login is missing a confirmed e-mail address" } ``` ```json { "error": "Your login is currently pending approval" } ``` ##### 422: Unprocessable entity 令牌没有授权用户 ```json { "error": "This method requires an authenticated user" } ``` --- ## 更新账户凭据 {#update_credentials} ```http PATCH /api/v1/accounts/update_credentials HTTP/1.1 ``` 更新用户的显示和偏好设置。 **返回:** 用户自己的 [Account]({{< relref "entities/Account">}}),带有 [`source`]({{< relref "entities/Account#source">}}) 属性\ **OAuth:** 用户令牌 + `write:accounts`\ **版本历史:**\ 1.1.1 - 添加\ 2.3.0 - 添加 `locked` 参数\ 2.4.0 - 添加 `source[privacy,sensitive]` 参数\ 2.4.2 - 添加 `source[language]` 参数\ 2.7.0 - 添加 `discoverable` 参数\ 4.1.0 - 添加 `hide_collections` 参数\ 4.2.0 - 添加 `indexable` 参数\ 4.4.0 (`mastodon` [API 版本]({{< relref "entities/Instance#api-versions" >}}) 3) - 添加 `attribution_domains` 参数 #### 请求 ##### 标头 Authorization : {{i have approximate knowledge of many things. perpetual student. (nb/ace/they)
xmpp/email: a@trwnh.com
https://trwnh.com
help me live: https://liberapay.com/at or https://paypal.me/trwnh
- my triggers are moths and glitter
- i have all notifs except mentions turned off, so please interact if you wanna be friends! i literally will not notice otherwise
- dm me if i did something wrong, so i can improve
- purest person on fedi, do not lewd in my presence
- #1 ami cole fan account
:fatyoshi:
", "url": "https://mastodon.social/@trwnh", "avatar": "https://files.mastodon.social/accounts/avatars/000/014/715/original/34aa222f4ae2e0a9.png", "avatar_static": "https://files.mastodon.social/accounts/avatars/000/014/715/original/34aa222f4ae2e0a9.png", "header": "https://files.mastodon.social/accounts/headers/000/014/715/original/5c6fc24edb3bb873.jpg", "header_static": "https://files.mastodon.social/accounts/headers/000/014/715/original/5c6fc24edb3bb873.jpg", "followers_count": 834, "following_count": 182, "statuses_count": 33760, "last_status_at": "2019-12-01T00:12:08.731Z", "source": { "privacy": "public", "sensitive": false, "language": "", "note": "i have approximate knowledge of many things. perpetual student. (nb/ace/they)\r\n\r\nxmpp/email: a@trwnh.com\r\nhttps://trwnh.com\r\nhelp me live: https://liberapay.com/at or https://paypal.me/trwnh\r\n\r\n- my triggers are moths and glitter\r\n- i have all notifs except mentions turned off, so please interact if you wanna be friends! i literally will not notice otherwise\r\n- dm me if i did something wrong, so i can improve\r\n- purest person on fedi, do not lewd in my presence\r\n- #1 ami cole fan account\r\n\r\n:fatyoshi:", "fields": [ { "name": "Website", "value": "https://trwnh.com", "verified_at": "2019-08-29T04:14:55.571+00:00" }, { "name": "Sponsor", "value": "https://liberapay.com/at", "verified_at": "2019-11-15T10:06:15.557+00:00" }, { "name": "Fan of:", "value": "Punk-rock and post-hardcore (Circa Survive, letlive., La Dispute, THE FEVER 333)Manga (Yu-Gi-Oh!, One Piece, JoJo's Bizarre Adventure, Death Note, Shaman King)Platformers and RPGs (Banjo-Kazooie, Boktai, Final Fantasy Crystal Chronicles)", "verified_at": null }, { "name": "Main topics:", "value": "systemic analysis, design patterns, anticapitalism, info/tech freedom, theory and philosophy, and otherwise being a genuine and decent wholesome poster. i'm just here to hang out and talk to cool people!", "verified_at": null } ], "follow_requests_count": 0 }, "emojis": [ { "shortcode": "fatyoshi", "url": "https://files.mastodon.social/custom_emojis/images/000/023/920/original/e57ecb623faa0dc9.png", "static_url": "https://files.mastodon.social/custom_emojis/images/000/023/920/static/e57ecb623faa0dc9.png", "visible_in_picker": true } ], "fields": [ { "name": "Website", "value": "https://trwnh.com", "verified_at": "2019-08-29T04:14:55.571+00:00" }, { "name": "Sponsor", "value": "https://liberapay.com/at", "verified_at": "2019-11-15T10:06:15.557+00:00" }, { "name": "Fan of:", "value": "Punk-rock and post-hardcore (Circa Survive, letlive., La Dispute, THE FEVER 333)Manga (Yu-Gi-Oh!, One Piece, JoJo's Bizarre Adventure, Death Note, Shaman King)Platformers and RPGs (Banjo-Kazooie, Boktai, Final Fantasy Crystal Chronicles)", "verified_at": null }, { "name": "Main topics:", "value": "systemic analysis, design patterns, anticapitalism, info/tech freedom, theory and philosophy, and otherwise being a genuine and decent wholesome poster. i'm just here to hang out and talk to cool people!", "verified_at": null } ] } ``` ##### 401: Unauthorized ```json { "error": "访问令牌无效" } ``` ##### 422: Unprocessable entity 令牌没有授权用户 ```json { "error": "This method requires an authenticated user" } ``` --- ## 获取账户 {#get} ```http GET /api/v1/accounts/:id HTTP/1.1 ``` 查看账户信息。 **返回:** [Account]({{< relref "entities/Account">}})\ **OAuth:** 公开\ **版本历史:**\ 0.0.0 - 添加\ 2.4.0 - 若账户已封禁,则返回 410\ 3.3.0 - 返回一个带有 `suspended: true` 的账户,而不是 410 #### 请求 ##### 路径参数 :id : {{Developer of Mastodon and administrator of mastodon.social. I post service announcements, development updates, and personal stuff.
", "url": "https://mastodon.social/@Gargron", "avatar": "https://files.mastodon.social/accounts/avatars/000/000/001/original/d96d39a0abb45b92.jpg", "avatar_static": "https://files.mastodon.social/accounts/avatars/000/000/001/original/d96d39a0abb45b92.jpg", "header": "https://files.mastodon.social/accounts/headers/000/000/001/original/c91b871f294ea63e.png", "header_static": "https://files.mastodon.social/accounts/headers/000/000/001/original/c91b871f294ea63e.png", "followers_count": 318699, "following_count": 453, "statuses_count": 61013, "last_status_at": "2019-11-30T20:02:08.277Z", "emojis": [], "fields": [ { "name": "Patreon", "value": "https://www.patreon.com/mastodon", "verified_at": null }, { "name": "Homepage", "value": "https://zeonfederated.com", "verified_at": "2019-07-15T18:29:57.191+00:00" } ] } ``` ###### 外站用户 ```json { "id": "23634", "username": "noiob", "acct": "noiob@awoo.space", "display_name": "shork", "locked": false, "bot": false, "created_at": "2017-02-08T02:00:53.274Z", "note": ":ms_rainbow_flag: :ms_bisexual_flag: :ms_nonbinary_flag: #awoo.space #admin ~ #bi ~ #nonbinary ~ compsci student ~ likes video #games and weird/ old electronics and will post obsessively about both ~ avatar by @dzuk
", "url": "https://awoo.space/@noiob", "avatar": "https://files.mastodon.social/accounts/avatars/000/023/634/original/6ca8804dc46800ad.png", "avatar_static": "https://files.mastodon.social/accounts/avatars/000/023/634/original/6ca8804dc46800ad.png", "header": "https://files.mastodon.social/accounts/headers/000/023/634/original/256eb8d7ac40f49a.png", "header_static": "https://files.mastodon.social/accounts/headers/000/023/634/original/256eb8d7ac40f49a.png", "followers_count": 553, "following_count": 405, "statuses_count": 28982, "last_status_at": "2019-12-01T00:39:57.264Z", "emojis": [ { "shortcode": "ms_rainbow_flag", "url": "https://files.mastodon.social/custom_emojis/images/000/028/691/original/6de008d6281f4f59.png", "static_url": "https://files.mastodon.social/custom_emojis/images/000/028/691/static/6de008d6281f4f59.png", "visible_in_picker": true }, { "shortcode": "ms_bisexual_flag", "url": "https://files.mastodon.social/custom_emojis/images/000/050/744/original/02f94a5fca7eaf78.png", "static_url": "https://files.mastodon.social/custom_emojis/images/000/050/744/static/02f94a5fca7eaf78.png", "visible_in_picker": true }, { "shortcode": "ms_nonbinary_flag", "url": "https://files.mastodon.social/custom_emojis/images/000/105/099/original/8106088bd4782072.png", "static_url": "https://files.mastodon.social/custom_emojis/images/000/105/099/static/8106088bd4782072.png", "visible_in_picker": true } ], "fields": [ { "name": "Pronouns", "value": "they/them", "verified_at": null }, { "name": "Alt", "value": "@noiob", "verified_at": null }, { "name": "Bots", "value": "@darksouls, @nierautomata, code for @awoobot", "verified_at": null }, { "name": "Website", "value": "http://shork.xyz", "verified_at": "2019-11-23T20:25:47.907+00:00" } ] } ``` ###### 已封禁用户 ```json { "id": "14", "username": "stigatle", "acct": "stigatle@quitter.no", "display_name": "", "locked": false, "bot": false, "discoverable": false, "group": false, "created_at": "2016-03-18T10:04:51.700Z", "note": "", "url": "https://quitter.no/stigatle", "avatar": "https://mastodon.social/avatars/original/missing.png", "avatar_static": "https://mastodon.social/avatars/original/missing.png", "header": "https://mastodon.social/headers/original/missing.png", "header_static": "https://mastodon.social/headers/original/missing.png", "followers_count": 0, "following_count": 0, "statuses_count": 0, "last_status_at": null, "suspended": true, "emojis": [], "fields": [] } ``` ##### 401: Unauthorized 若实例处于白名单模式,且 `Authorization` 标头缺失或无效。 ```json { "error": "此 API 需要已认证的用户" } ``` ##### 404: Not found 账户不存在。 ```json { "error": "记录未找到" } ``` ##### 410: Gone 账户已被封禁(版本 2.4.0 起至 3.3.0 止)。 --- ## 获取多个账户信息 {#index} ```http GET /api/v1/accounts HTTP/1.1 ``` 查看多个账户的信息。 **返回:** [Account]({{< relref "entities/Account">}}) 数组 **OAuth:** 公开 **版本历史:** 4.3.0 - 添加 #### 请求 ##### 标头 ##### 查询参数 id[] : 字符串数组。数据库中账户的 ID。 ##### 标头 Authorization : 提供此标头并附带 `Bearer <用户令牌>` 以获得对此 API 方法的访问授权。 #### 响应 ##### 200: OK 将返回请求的已验证且已被批准账户的 [Account]({{< relref "entities/Account">}}) 记录。若账户不存在或未确认,返回的记录数可能会少于请求的数量。 使用 `id[]=1&id[]=2` 的调用示例(当 ID 为 2 的账户不存在时): ```json [ { "id": "1", "username": "Gargron", "acct": "Gargron", "display_name": "Eugen", "locked": false, "bot": false, "created_at": "2016-03-16T14:34:26.392Z", "note": "Developer of Mastodon and administrator of mastodon.social. I post service announcements, development updates, and personal stuff.
", "url": "https://mastodon.social/@Gargron", "avatar": "https://files.mastodon.social/accounts/avatars/000/000/001/original/d96d39a0abb45b92.jpg", "avatar_static": "https://files.mastodon.social/accounts/avatars/000/000/001/original/d96d39a0abb45b92.jpg", "header": "https://files.mastodon.social/accounts/headers/000/000/001/original/c91b871f294ea63e.png", "header_static": "https://files.mastodon.social/accounts/headers/000/000/001/original/c91b871f294ea63e.png", "followers_count": 318699, "following_count": 453, "statuses_count": 61013, "last_status_at": "2019-11-30T20:02:08.277Z", "emojis": [], "fields": [ { "name": "Patreon", "value": "https://www.patreon.com/mastodon", "verified_at": null }, { "name": "Homepage", "value": "https://zeonfederated.com", "verified_at": "2019-07-15T18:29:57.191+00:00" } ] } ] ``` ##### 401: Unauthorized 若实例处于白名单模式,且 `Authorization` 标头缺失或无效,则返回此错误。 ```json { "error": "This API requires an authenticated user" } ``` --- ## 获取账户的嘟文 {#statuses} ```http GET /api/v1/accounts/:id/statuses HTTP/1.1 ``` 获取指定账户发布的嘟文。 **返回:** [Status]({{< relref "entities/status">}}) 数组 **OAuth:** 公开访问(仅限公开嘟文),或用户令牌 + `read:statuses`(用于访问用户有权查看的私密嘟文) **版本历史:** 0.0.0 - 添加 1.4.2 - 添加 `only_media` 和 `exclude_replies` 1.6.0 - 添加 `pinned` 2.6.0 - 添加 `min_id` 2.7.0 - 添加 `exclude_reblogs` 并允许未经身份验证的使用 2.8.0 - 添加 `tagged` 参数 3.3.0 - 现在可以同时使用 `min_id` 和 `max_id` #### 请求 ##### 路径参数 :id : {{