Merge branch 'mastodon:main' into main

This commit is contained in:
John Haugabook 2024-05-07 15:50:49 -04:00 committed by GitHub
commit bd45132c6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 230 additions and 6 deletions

View File

@ -22,6 +22,7 @@ aliases: [
{
"id": "1",
"domain": "example.com",
"digest": "a379a6f6eeafb9a55e378c118034e2751e682fab9f2d30ab13d2125586ce1947",
"created_at": "2022-11-16T08:15:34.238Z",
"severity": "noop",
"reject_media": false,
@ -48,6 +49,13 @@ aliases: [
**Version history:**\
4.0.0 - added
### `digest` {#digest}
**Description:** The sha256 hex digest of the domain that is not allowed to federated.\
**Type:** String\
**Version history:**\
4.3.0 - added
### `created_at` {#created_at}
**Description:** When the domain was blocked from federating.\
@ -104,4 +112,4 @@ aliases: [
{{< page-relref page="methods/admin/domain_blocks" caption="admin/domain_blocks API methods" >}}
{{< caption-link url="https://github.com/mastodon/mastodon/blob/main/app/serializers/rest/admin/domain_block_serializer.rb" caption="app/serializers/rest/admin/domain_block_serializer.rb" >}}
{{< caption-link url="https://github.com/mastodon/mastodon/blob/main/app/serializers/rest/admin/domain_block_serializer.rb" caption="app/serializers/rest/admin/domain_block_serializer.rb" >}}

View File

@ -722,6 +722,88 @@ Account is suspended (since 2.4.0 and until 3.3.0)
---
## Get multiple accounts {#index}
```http
GET /api/v1/accounts HTTP/1.1
```
View information about multiple profiles.
**Returns:** Array of [Account]({{< relref "entities/Account">}})\
**OAuth:** Public\
**Version history:**\
4.3.0 - added
#### Request
##### Headers
##### Query parameters
id[]
: Array of String. The IDs of the Accounts in the database.
##### Headers
Authorization
: Provide this header with `Bearer <user token>` to gain authorized access to this API method.
#### Response
##### 200: OK
[Account]({{< relref "entities/Account">}}) records for the requested confirmed and approved accounts will be returned. There can be fewer records than requested if the accounts do not exist or are not confirmed.
Sample call with `id[]=1&id[]=2` when no account with `id=2` exists:
```json
[
{
"id": "1",
"username": "Gargron",
"acct": "Gargron",
"display_name": "Eugen",
"locked": false,
"bot": false,
"created_at": "2016-03-16T14:34:26.392Z",
"note": "<p>Developer of Mastodon and administrator of mastodon.social. I post service announcements, development updates, and personal stuff.</p>",
"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": "<a href=\"https://www.patreon.com/mastodon\" rel=\"me nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https://www.</span><span class=\"\">patreon.com/mastodon</span><span class=\"invisible\"></span></a>",
"verified_at": null
},
{
"name": "Homepage",
"value": "<a href=\"https://zeonfederated.com\" rel=\"me nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https://</span><span class=\"\">zeonfederated.com</span><span class=\"invisible\"></span></a>",
"verified_at": "2019-07-15T18:29:57.191+00:00"
}
]
}
]
```
##### 401: Unauthorized
If the instance is in whitelist mode and the Authorization header is missing or invalid
```json
{
"error": "This API requires an authenticated user"
}
```
---
## Get account's statuses {#statuses}
```http

View File

@ -60,6 +60,7 @@ limit
{
"id": "1",
"domain": "example.com",
"digest": "a379a6f6eeafb9a55e378c118034e2751e682fab9f2d30ab13d2125586ce1947",
"created_at": "2022-11-16T08:15:34.238Z",
"severity": "noop",
"reject_media": false,
@ -120,6 +121,7 @@ Authorization
{
"id": "1",
"domain": "example.com",
"digest": "a379a6f6eeafb9a55e378c118034e2751e682fab9f2d30ab13d2125586ce1947",
"created_at": "2022-11-16T08:15:34.238Z",
"severity": "noop",
"reject_media": false,
@ -146,7 +148,7 @@ DomainBlock with the given ID does not exist
```json
{
"error": "Record not found"
"error": "Record not found"
}
```
@ -205,6 +207,7 @@ Domain has been blocked from federating.
{
"id": "1",
"domain": "example.com",
"digest": "a379a6f6eeafb9a55e378c118034e2751e682fab9f2d30ab13d2125586ce1947",
"created_at": "2022-11-16T08:15:34.238Z",
"severity": "noop",
"reject_media": false,
@ -225,13 +228,35 @@ Authorized user is not allowed to perform this action, or invalid or missing Aut
}
```
##### 422: Unprocessable entity
##### 422: Unprocessable entity - Missing Parameter
The domain parameter was not provided
```json
{
"error": "Validation failed: Domain can't be blank"
"error": "Validation failed: Domain can't be blank"
}
```
##### 422: Unprocessable entity - Existing Domain Block
The domain parameter already is covered by an existing domain block.
```json
{
"error": "You have already imposed stricter limits on example.com."
"existing_domain_block": {
"id": "1",
"domain": "example.com",
"digest": "a379a6f6eeafb9a55e378c118034e2751e682fab9f2d30ab13d2125586ce1947",
"created_at": "2022-11-16T08:15:34.238Z",
"severity": "noop",
"reject_media": false,
"reject_reports": false,
"private_comment": null,
"public_comment": null,
"obfuscate": false
}
}
```
@ -292,6 +317,7 @@ Domain block has been updated
{
"id": "1",
"domain": "example.com",
"digest": "a379a6f6eeafb9a55e378c118034e2751e682fab9f2d30ab13d2125586ce1947",
"created_at": "2022-11-16T08:15:34.238Z",
"severity": "noop",
"reject_media": false,
@ -368,7 +394,7 @@ DomainBlock with the given ID does not exist
```json
{
"error": "Record not found"
"error": "Record not found"
}
```
@ -376,4 +402,4 @@ DomainBlock with the given ID does not exist
## See also
{{< caption-link url="https://github.com/mastodon/mastodon/blob/main/app/controllers/api/v1/admin/domain_blocks_controller.rb" caption="app/controllers/api/v1/admin/domain_blocks_controller.rb" >}}
{{< caption-link url="https://github.com/mastodon/mastodon/blob/main/app/controllers/api/v1/admin/domain_blocks_controller.rb" caption="app/controllers/api/v1/admin/domain_blocks_controller.rb" >}}

View File

@ -257,6 +257,114 @@ Status does not exist or is private.
---
## View multiple statuses {#index}
```http
GET /api/v1/statuses HTTP/1.1
```
Obtain information about multiple statuses.
**Returns:** Array of [Status]({{< relref "entities/status" >}})\
**OAuth:** Public for public statuses, user token + `read:statuses` for private statuses\
**Version history:**\
4.3.0 - added
#### Request
##### Query parameters
id[]
: Array of String. The IDs of the Statuses in the database.
##### Headers
Authorization
: Provide this header with `Bearer <user token>` to gain authorized access to this API method.
#### Response
##### 200: OK
[Status]({{< relref "entities/status" >}}) records for the requested statuses will be returned. There can be fewer records than requested if the requested statuses do not exist or cannot be accessed given the current credentials.
Sample call with `id[]=1&id[]=2` when no status with `id=2` exists:
```json
[
{
"id": "1",
"created_at": "2016-03-16T14:44:31.580Z",
"in_reply_to_id": null,
"in_reply_to_account_id": null,
"sensitive": false,
"spoiler_text": "",
"visibility": "public",
"language": "en",
"uri": "https://mastodon.social/users/Gargron/statuses/1",
"url": "https://mastodon.social/@Gargron/1",
"replies_count": 7,
"reblogs_count": 98,
"favourites_count": 112,
"favourited": false,
"reblogged": false,
"muted": false,
"bookmarked": false,
"content": "<p>Hello world</p>",
"reblog": null,
"application": null,
"account": {
"id": "1",
"username": "Gargron",
"acct": "Gargron",
"display_name": "Eugen",
"locked": false,
"bot": false,
"created_at": "2016-03-16T14:34:26.392Z",
"note": "<p>Developer of Mastodon and administrator of mastodon.social. I post service announcements, development updates, and personal stuff.</p>",
"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": 320472,
"following_count": 453,
"statuses_count": 61163,
"last_status_at": "2019-12-05T03:03:02.595Z",
"emojis": [],
"fields": [
{
"name": "Patreon",
"value": "<a href=\"https://www.patreon.com/mastodon\" rel=\"me nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https://www.</span><span class=\"\">patreon.com/mastodon</span><span class=\"invisible\"></span></a>",
"verified_at": null
},
{
"name": "Homepage",
"value": "<a href=\"https://zeonfederated.com\" rel=\"me nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https://</span><span class=\"\">zeonfederated.com</span><span class=\"invisible\"></span></a>",
"verified_at": "2019-07-15T18:29:57.191+00:00"
}
]
},
"media_attachments": [],
"mentions": [],
"tags": [],
"emojis": [],
"card": null,
"poll": null
}
]
```
##### 401: Unauthorized
Instance is in authorized-fetch mode.
```json
{
"error": "This API requires an authenticated user"
}
```
---
## Delete a status {#delete}
```http