]> git.mxchange.org Git - friendica.git/blobdiff - doc/API-Mastodon.md
spelling: mailing
[friendica.git] / doc / API-Mastodon.md
index 17c6ea8fe3dce886d6846f0953e97f63533a455e..2a6e8ed25ed331417458c97bf1ece33106016285 100644 (file)
@@ -29,7 +29,30 @@ For supported apps please have a look at the [FAQ](help/FAQ#clients)
 
 ## Entities
 
-These endpoints use the [Mastodon API entities](https://docs.joinmastodon.org/entities/). With some additional extensions listed below.
+These endpoints use the [Mastodon API entities](https://docs.joinmastodon.org/entities/).
+With some additional extensions listed below.
+
+### Instance (Version 2) Entities
+Extensions to the [Mastodon Instance::V2 Entities](https://docs.joinmastodon.org/entities/Instance/)
+* `friendica`: Friendica specific properties of the V2 Instance including:
+    * `version`: The Friendica version string
+    * `codename`: The Friendica version code name
+    * `db_version`: The database schema version number
+
+Example: 
+```json
+{
+  "domain": "friendicadevtest1.myportal.social",
+  "title": "Friendica Social Network",
+  "version": "2.8.0 (compatible; Friendica 2023.03-dev)",
+  ...
+  "friendica": {
+    "version": "2023.03-dev",
+    "codename": "Giant Rhubarb",
+    "db_version": 1516
+  }
+}
+```
 
 ### Notification Entities
 Extensions to the [Mastodon Notification Entities](https://docs.joinmastodon.org/entities/Notification/)
@@ -40,6 +63,10 @@ Extensions to the [Mastodon Status Entities](https://docs.joinmastodon.org/entit
 * `in_reply_to_status`: A fully populated Mastodon Status entity for the replied to status or null it is a post rather than a response
 * `friendica`: Friendica specific properties of a status including:
   * `title`: The Friendica title for a post, or empty if the status is a comment
+  * `delivery_data`: Information about the state of federating a message from the server
+    * `delivery_queue_count`: Total number of remote servers that the status needs to be federated to.
+    * `delivery_queue_done`: Total number of remote servers that have successfully been federated to so far.
+    * `delivery_queue_failed`: Total number of remote servers that have we failed to federate to so far.
   * `dislikes_count`: The number of dislikes that a status has accumulated according to the server.
 
 Example:
@@ -49,26 +76,26 @@ Example:
   "created_at": "2023-02-23T02:45:46.000Z",
   "in_reply_to_id": "356",
   "in_reply_to_status": {
-       "id": "356",
-       "created_at": "2023-02-23T02:45:35.000Z",
-       "in_reply_to_id": null,
-       "in_reply_to_status": null,
-       "in_reply_to_account_id": null,
-       ...
-       "content": "A post from testuser1",
-       ...
-       "account": {
-         "id": "6",
-         "username": "testuser1",
-         "acct": "testuser1",
-         "display_name": "testuser1",
-         ...
-       },
-       ...
-       "friendica": {
-         "title": "",
-         "dislikes_count": 0
-       }
+    "id": "356",
+    "created_at": "2023-02-23T02:45:35.000Z",
+    "in_reply_to_id": null,
+    "in_reply_to_status": null,
+    "in_reply_to_account_id": null,
+    ...
+    "content": "A post from testuser1",
+    ...
+    "account": {
+      "id": "6",
+      "username": "testuser1",
+      "acct": "testuser1",
+      "display_name": "testuser1",
+      ...
+    },
+    ...
+    "friendica": {
+      "title": "",
+      "dislikes_count": 0
+    }
   },
   "in_reply_to_account_id": "6",
   ...
@@ -79,16 +106,21 @@ Example:
   "content": "A reply from testuser2",
   ...
   "account": {
-       "id": "8",
-       "username": "testuser2",
-       "acct": "testuser2",
-       "display_name": "testuser2",
-       ...
+    "id": "8",
+    "username": "testuser2",
+    "acct": "testuser2",
+    "display_name": "testuser2",
+    ...
   },
   ...
   "friendica": {
-       "title": "",
-       "dislikes_count": 0
+    "title": "",
+    "delivery_data": {
+      "delivery_queue_count": 10,
+      "delivery_queue_done": 3, 
+      "delivery_queue_failed": 0
+    },
+    "dislikes_count": 0
   }
 }
 ```
@@ -154,7 +186,7 @@ Example:
 - [`PUT /api/v1/media/:id`](https://docs.joinmastodon.org/methods/statuses/media/)
 - [`GET /api/v1/mutes`](https://docs.joinmastodon.org/methods/accounts/mutes/)
 - [`GET /api/v1/notifications`](https://docs.joinmastodon.org/methods/notifications/)
-       - Additional field `include_all` to return read and unread statuses, defaults to `false`
+    - Additional field `include_all` to return read and unread statuses, defaults to `false`
     - Additional field `summary` returns a count of all of the statuses that match the type filter
     - Additional field `with_muted` Pleroma extension to return notifications from muted users, defaults to `false`
     - Does not support the `type` field, which is the mirror image of the supported `exclude_types` field
@@ -174,10 +206,10 @@ Example:
 - [`GET /api/v1/search`](https://docs.joinmastodon.org/methods/search/)
 - [`PUT /api/v1/statuses`](https://docs.joinmastodon.org/methods/statuses/#edit)
     - Does not support `polls` argument as Friendica does not have polls
-       - Additional fields `friendica` for Friendica specific parameters:
-               - `title`: Explicitly sets the title for a post status, ignored if used on a comment status. For post statuses the legacy behavior is to use any "spoiler text" as the title if it is provided. If both the title and spoiler text are provided for a post status then they will each be used for their respective roles. If no title is provided then the legacy behavior will persist. If you want to create a post with no title but spoiler text then explicitly set the title but set it to an empty string `""`.
+    - Additional fields `friendica` for Friendica specific parameters:
+        - `title`: Explicitly sets the title for a post status, ignored if used on a comment status. For post statuses the legacy behavior is to use any "spoiler text" as the title if it is provided. If both the title and spoiler text are provided for a post status then they will each be used for their respective roles. If no title is provided then the legacy behavior will persist. If you want to create a post with no title but spoiler text then explicitly set the title but set it to an empty string `""`.
 - [`POST /api/v1/statuses`](https://docs.joinmastodon.org/methods/statuses/#create)
-       - Does not support `polls` argument as Friendica does not have polls
+    - Does not support `polls` argument as Friendica does not have polls
     - Additionally to the static values `public`, `unlisted` and `private`, the `visibility` parameter can contain a numeric value with a group id.
     - Additional field `quote_id` for the post that is being quote reshared
     - Additional fields `friendica` for Friendica specific parameters:
@@ -209,30 +241,30 @@ Example:
 - [`GET /api/v1/tags/:id/unfollow`](https://docs.joinmastodon.org/methods/tags/#unfollow)
 - [`GET /api/v1/timelines/direct`](https://docs.joinmastodon.org/methods/timelines/)
 - [`GET /api/v1/timelines/home`](https://docs.joinmastodon.org/methods/timelines/)
-       - Additional field `with_muted` Pleroma extension to return notifications from muted users, defaults to `false`
+    - Additional field `with_muted` Pleroma extension to return notifications from muted users, defaults to `false`
     - Additional field `exclude_replies` to only return post statuses not replies/comments, defaults to `false`
 - [`GET /api/v1/timelines/list/:id`](https://docs.joinmastodon.org/methods/timelines/)
-       - Additional field `with_muted` Pleroma extension to return notifications from muted users, defaults to `false`
-       - Additional field `exclude_replies` to only return post statuses not replies/comments, defaults to `false`
+    - Additional field `with_muted` Pleroma extension to return notifications from muted users, defaults to `false`
+    - Additional field `exclude_replies` to only return post statuses not replies/comments, defaults to `false`
 - [`GET /api/v1/timelines/public`](https://docs.joinmastodon.org/methods/timelines/)
-       - Additional field `with_muted` Pleroma extension to return notifications from muted users, defaults to `false`
-       - Additional field `exclude_replies` to only return post statuses not replies/comments, defaults to `false`
+    - Additional field `with_muted` Pleroma extension to return notifications from muted users, defaults to `false`
+    - Additional field `exclude_replies` to only return post statuses not replies/comments, defaults to `false`
 - [`GET /api/v1/timelines/tag/:hashtag`](https://docs.joinmastodon.org/methods/timelines/)
-       - Additional field `with_muted` Pleroma extension to return notifications from muted users, defaults to `false`
-       - Additional field `exclude_replies` to only return post statuses not replies/comments, defaults to `false`
+    - Additional field `with_muted` Pleroma extension to return notifications from muted users, defaults to `false`
+    - Additional field `exclude_replies` to only return post statuses not replies/comments, defaults to `false`
     - Does not support the `any[]`, `all[]`, or `none[]` query parameters
 - [`GET /api/v1/trends`](https://docs.joinmastodon.org/methods/instance/trends/)
 - [`GET /api/v1/trends/links`](https://github.com/mastodon/mastodon/pull/16917)
 - [`GET /api/v1/trends/statuses`](https://docs.joinmastodon.org/methods/trends/#statuses)
 - [`GET /api/v1/trends/tags`](https://docs.joinmastodon.org/methods/trends/#tags)
-       - Additional field `friendica_local` to return local trending tags instead of global tags, defaults to `false`
+    - Additional field `friendica_local` to return local trending tags instead of global tags, defaults to `false`
 - [`GET /api/v2/instance`](https://docs.joinmastodon.org/methods/instance/#v2)
 - [`GET /api/v2/search`](https://docs.joinmastodon.org/methods/search/)
 
 
 ## Currently unimplemented endpoints
 
-These emdpoints are planned to be implemented somewhere in the future.
+These endpoints are planned to be implemented somewhere in the future.
 
 - [`POST /api/v1/accounts/:id/remove_from_followers`](https://github.com/mastodon/mastodon/pull/16864)
 - [`GET /api/v1/accounts/familiar_followers`](https://github.com/mastodon/mastodon/pull/17700)