documentation/content/en/entities/Announcement.md

211 lines
5.6 KiB
Markdown
Raw Normal View History

Update content for 4.0 (part 1) (#991) * add rules * join date on profiles * deprecate follow scope * deprecate identity proofs * familiar followers * use definition lists instead of tables for defining activitypub properties * reformat notifications page into markdown * fix broken links to publicKey header * Application website is now nullable * update environment variables added and removed * fix typo * fix heading level * min_id and max_id can be used at the same time (3.3) * fix typo * new tootctl options * reformat tootctl page to use definition lists for params * add rules and configuration to Instance * fix typo * refactor instance api page * 3.3.0 duration on mutes * 3.3.0 mute_expires_at * improve section headings * 3.4.0 resend email confirmation api * 3.4.0 policy on push subscriptions * 3.4.0 add details to account registration error * refactor accounts api page and start adding relrefs to entity pages * 3.4.0 accounts/lookup api * add see also to accounts methods * add more see-also links * 3.5.0 appeal mod decisions * 3.5.0 reformat reports and add category/rule_ids params * document report entity and missing responses * fix typos * fix relrefs and url schema, add aliases to old urls * add archetypes for new methods/entities * update archetypes with see-also stubs * clearer presentation of rate limits * announcements api methods * refactor apps methods * refactor bookmarks methods + some anchors * refactor conversations methods * custom_emojis methods refactor * anchors * refactor directory methods * refactor domain_blocks methods * add see also to emails methods * fix page relref shortcodes to specific methods + refactor endorsements methods * min_id max_id * refactor favourites methods * refactor featured_tags methods * refactor filters methods, make path params consistent, i18n required shortcode * follow_requests methods * lists methods * markers methods * forgot to add entity links * media methods, also fix formatting of some json errors * mutes methods, add more see-also links * oembed methods * preferences methods * proofs methods * push methods * suggestions methods * 3.5.0 add new trend types, fix formatting * refactor streaming methods * refactor oauth methods * note that streaming api casts payload to string * refactor search methods * refactor polls methods * remove unnecessary link * reformat scheduled_statuses methods * reformat timelines methods * reformat statuses methods * 3.5.0 editing statuses * consistent use of array brackets in form data parameters * update dev setup guide, add vagrant and clean up text * add admin/accounts methods * 3.6 role entity * admin/accounts methods v2 * minor fix * stub admin/reports methods * document admin reports * add 403 example to methods archetype * cleanup entities for admin reports and add new attrs * 3.6.0 domain allows methods + normalize admin entity namespace * fix search-and-replace error * add aliases for admin entities * 3.6.0 canonical email blocks entity * 3.5.0 admin/retention api * 3.5.0 add admin::ip doc * 3.5.0 admin/reports * 3.6.0 admin/domain_allows * 3.5.0 admin/dimensions * 3.6.0 permissions and roles * minor formatting fix * add anchor link to headings * checkpoint * add update commands to dev env setup guide * change mentions of v3.6 to v4.0 * tootctl now uses custom roles * fix formatting * v2 instance api * update frontmatter, add better titles to pages * minor wording change * consistency * add more aliases * add placeholders and WIP notices * explain link pagination and stub out todos * switch baseURL to https * 422 on reports with rules but category!=violation * document bug fixes * fix typo * remove duplicate API method definition * s/tootsuite/mastodon for github links * remove unnecessary escaping * s/tootsuite/mastodon in Entity archetype * add missing nullable shortcode * clarify oauth scope when requesting a user token * api/v2/media now synchronous for images * DISALLOW_UNAUTHENTICATED_API_ACCESS * add undocumented env variables * add instance domain blocks and extended description api * add SMTP_ENABLE_STARTTLS * add description to SMTP_ENABLE_STARTTLS * take suggestions from open PRs * normalize links and flavour language * Fully document streaming API based on source code * Add mention of MIME types * bump to ruby 3.0.4 * clarify how to check on async media processing * validation of replies_policy * remove TODOs on admin account action * EmailDomainBlocks * IpBlocks * Admin::DomainBlock * remove TODOs * following hashtags * followed_tags * remove reference to unused parameter * add new oauth scopes for admin blocks and allows * fix command signature for i18n-tasks normalize * reformat code structure page * document fixes for following tags (assume 4.0.3) * Add warning about pre-4.0 hardcoded roles * add note about case sensitivity * remove use of 'simply' from docs * remove reference to silencing * add reference to IDN normalization for verified links * add lang parameter
2022-11-20 07:34:38 +01:00
---
title: Announcement
description: Represents an announcement set by an administrator.
menu:
docs:
parent: entities
aliases: [
"/entities/announcement",
"/entities/Announcement",
"/api/entities/announcement",
"/api/entities/Announcement",
]
---
## Example
```json
{
"id": "8",
"content": "<p>Looks like there was an issue processing audio attachments without embedded art since yesterday due to an experimental new feature. That issue has now been fixed, so you may see older posts with audio from other servers pop up in your feeds now as they are being finally properly processed. Sorry!</p>",
"starts_at": null,
"ends_at": null,
"all_day": false,
"published_at": "2020-07-03T01:27:38.726Z",
"updated_at": "2020-07-03T01:27:38.752Z",
"read": true,
"mentions": [],
"statuses": [],
"tags": [],
"emojis": [],
"reactions": [
{
"name": "bongoCat",
"count": 9,
"me": false,
"url": "https://files.mastodon.social/custom_emojis/images/000/067/715/original/fdba57dff7576d53.png",
"static_url": "https://files.mastodon.social/custom_emojis/images/000/067/715/static/fdba57dff7576d53.png"
},
{
"name": "thonking",
"count": 1,
"me": false,
"url": "https://files.mastodon.social/custom_emojis/images/000/098/690/original/a8d36edc4a7032e8.png",
"static_url": "https://files.mastodon.social/custom_emojis/images/000/098/690/static/a8d36edc4a7032e8.png"
},
{
"name": "AAAAAA",
"count": 1,
"me": false,
"url": "https://files.mastodon.social/custom_emojis/images/000/071/387/original/AAAAAA.png",
"static_url": "https://files.mastodon.social/custom_emojis/images/000/071/387/static/AAAAAA.png"
},
{
"name": "🤔",
"count": 1,
"me": true
}
]
}
```
## Attributes
### `id` {#id}
**Description:** The ID of the announcement in the database.\
**Type:** String (cast from an integer, but not guaranteed to be a number)\
**Version history:**\
3.1.0 - added
### `content` {#content}
**Description:** The text of the announcement.\
**Type:** String (HTML)\
**Version history:**\
3.1.0 - added
### `starts_at` {#starts_at}
**Description:** When the announcement will start.\
**Type:** {{<nullable>}} String (ISO 8601 Datetime) or null\
**Version history:**\
3.1.0 - added
### `ends_at` {#ends_at}
**Description:** When the announcement will end.\
**Type:** {{<nullable>}} String (ISO 8601 Datetime) or null\
**Version history:**\
3.1.0 - added
### `published` {#published}
**Description:** Whether the announcement is currently active.\
**Type:** Boolean\
**Version history:**\
3.1.0 - added
### `all_day` {#all_day}
**Description:** Whether the announcement should start and end on dates only instead of datetimes. Will be false if there is no `starts_at` or `ends_at` time.\
**Type:** Boolean\
**Version history:**\
3.1.0 - added
### `published_at` {#created_at}
**Description:** When the announcement was published.\
**Type:** String (ISO 8601 Datetime)\
**Version history:**\
3.1.0 - added
### `updated_at` {#updated_at}
**Description:** When the announcement was last updated.\
**Type:** String (ISO 8601 Datetime)\
**Version history:**\
3.1.0 - added
### `read` {{%optional%}} {#read}
**Description:** Whether the announcement has been read by the current user.\
**Type:** Boolean\
**Version history:**\
3.1.0 - added
### `mentions` {#mentions}
**Description:** Accounts mentioned in the announcement text.\
**Type:** Array of [Announcement::Account](#Account)\
**Version history:**\
3.1.0 - added
### `statuses` {#statuses}
**Description:** Statuses linked in the announcement text.\
**Type:** Array of [Announcement::Status](#Status)\
**Version history:**\
3.1.0 - added
### `tags` {#tags}
**Description:** Tags linked in the announcement text.\
**Type:** Array of [Status::Tag]({{< relref "entities/Status#Tag" >}})\
**Version history:**\
3.1.0 - added
### `emojis` {#emojis}
**Description:** Custom emoji used in the announcement text.\
**Type:** Array of [CustomEmoji]({{< relref "entities/CustomEmoji" >}})\
**Version history:**\
3.1.0 - added
### `reactions` {#reactions}
**Description:** Emoji reactions attached to the announcement.\
**Type:** Array of [Reaction]({{< relref "entities/Reaction" >}})\
**Version history:**\
3.1.0 - added
## Announcement::Account attributes {#Account}
### `id` {#Account-id}
**Description:** The account ID of the mentioned user.\
**Type:** String (cast from an integer, but not guaranteed to be a number)\
**Version history:**\
3.1.0 - added
### `username` {#Account-username}
**Description:** The username of the mentioned user.\
**Type:** String\
**Version history:**\
3.1.0 - added
### `url` {#Account-url}
**Description:** The location of the mentioned user's profile.\
**Type:** String (URL)\
**Version history:**\
3.1.0 - added
### `acct` {#Account-acct}
**Description:** The webfinger acct: URI of the mentioned user. Equivalent to `username` for local users, or `username@domain` for remote users.\
**Type:** String\
**Version history:**\
3.1.0 - added
## Announcement::Status attributes {#Status}
### `id` {#Status-id}
**Description:** The ID of an attached Status in the database.\
**Type:** String (cast from an integer, but not guaranteed to be a number)\
**Version history:**\
3.1.0 - added
### `url` {#Status-url}
**Description:** The URL of an attached Status.\
**Type:** String (URL)\
**Version history:**\
3.1.0 - added
## See also
{{< page-relref ref="methods/announcements" caption="announcements API methods" >}}
{{< caption-link url="https://github.com/mastodon/mastodon/blob/main/app/serializers/rest/announcement_serializer.rb" caption="app/serializers/rest/announcement_serializer.rb" >}}