1
0
mirror of https://github.com/mastodon/documentation synced 2025-04-11 22:56:17 +02:00
documentation/content/en/entities/NotificationRequest.md
Nik Clayton 49868155b9
feat: Document datetime and date formats (#1565)
Add a new document that precisely describes the string representation of
datetime and date types.

The previous description of them as "ISO 8601 Datetime" was very
imprecise, as ISO 8601 describes many different ways of representing a
datetime and date.

Specify the datetime format precisely as the ISO 8601 profile described
in RFC 3339, and the date format precisely as the "Complete date" format
from the W3C note on date and time formats.

Adjust all the references to ISO 8601 datetimes or dates to link back
to the definition.

Fixes #1420
2024-11-27 15:08:51 +00:00

105 lines
2.7 KiB
Markdown

---
title: NotificationRequest
description: Represents a group of filtered notifications from a specific user.
menu:
docs:
parent: entities
aliases: [
"/entities/NotificationRequest",
]
---
## Attributes
### `id` {#id}
**Description:** The id of the notification request in the database.\
**Type:** String (cast from an integer, but not guaranteed to be a number)\
**Version history:**\
4.3.0 - added
### `created_at` {#created_at}
**Description:** The timestamp of the notification request, i.e. when the first filtered notification from that user was created.\
**Type:** String ([Datetime](/api/datetime-format#datetime))\
**Version history:**\
4.3.0 - added
### `updated_at` {#updated_at}
**Description:** The timestamp of when the notification request was last updated.\
**Type:** String ([Datetime](/api/datetime-format#datetime))\
**Version history:**\
4.3.0 - added
### `account` {#account}
**Description:** The account that performed the action that generated the filtered notifications.\
**Type:** [Account]({{< relref "entities/Account" >}})\
**Version history:**\
4.3.0 - added
### `notifications_count` {#notifications_count}
**Description:** How many of this account's notifications were filtered.\
**Type:** String\
**Version history:**\
4.3.0 - added
### `last_status` {{%optional%}} {#last_status}
**Description:** Most recent status associated with a filtered notification from that account.\
**Type:** [Status]({{< relref "entities/Status" >}})\
**Version history:**\
4.3.0 - added
## Example
```json
{
"id": "112456967201894256",
"created_at": "2024-05-17T14:45:41.171Z",
"updated_at": "2024-05-17T14:45:41.171Z",
"notifications_count": "1",
"account": {
"id": "971724",
"username": "zsc",
"acct": "zsc",
// ...
},
"last_status": {
"id": "103186126728896492",
"created_at": "2019-11-23T07:49:01.940Z",
"in_reply_to_id": "103186038209478945",
"in_reply_to_account_id": "14715",
// ...
"content": "<p><span class=\"h-card\"><a href=\"https://mastodon.social/@trwnh\" class=\"u-url mention\">@<span>trwnh</span></a></span> sup!</p>",
// ...
"account": {
"id": "971724",
"username": "zsc",
"acct": "zsc",
// ...
},
// ...
"mentions": [
{
"id": "14715",
"username": "trwnh",
"url": "https://mastodon.social/@trwnh",
"acct": "trwnh"
}
],
// ...
}
}
```
## See also
{{< page-relref ref="methods/notifications" caption="notifications API methods" >}}
{{< caption-link url="https://github.com/mastodon/mastodon/blob/main/app/serializers/rest/notification_request_serializer.rb" caption="app/serializers/rest/notification_request_serializer.rb" >}}