From 95d615ec1c3e6bd1eb0bb023c8137ab8acd158d5 Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Wed, 22 Feb 2023 20:47:55 -0500 Subject: [PATCH 01/15] Add new Mastodon InstanceV2 to implemented list and fix doc links --- doc/API-Mastodon.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/API-Mastodon.md b/doc/API-Mastodon.md index 03d6e3f26e..dc068202fa 100644 --- a/doc/API-Mastodon.md +++ b/doc/API-Mastodon.md @@ -73,8 +73,8 @@ These endpoints use the [Mastodon API entities](https://docs.joinmastodon.org/en - `:id` is a follow request ID, not a regular account id - Returns a [Relationship](https://docs.joinmastodon.org/entities/relationship) object. -- [`GET /api/v1/followed_tags'](https://docs.joinmastodon.org/methods/followed_tags/) -- [`GET /api/v1/instance`](https://docs.joinmastodon.org/methods/instance#fetch-instance) +- [`GET /api/v1/followed_tags`](https://docs.joinmastodon.org/methods/followed_tags/) +- [`GET /api/v1/instance`](https://docs.joinmastodon.org/methods/instance/#v1) - `GET /api/v1/instance/rules` Undocumented, returns Terms of Service - [`GET /api/v1/instance/peers`](https://docs.joinmastodon.org/methods/instance#list-of-connected-domains) - [`GET /api/v1/lists`](https://docs.joinmastodon.org/methods/timelines/lists/) @@ -139,6 +139,7 @@ These endpoints use the [Mastodon API entities](https://docs.joinmastodon.org/en - [`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) +- [`GET /api/v2/instance`](https://docs.joinmastodon.org/methods/instance/#v2) - [`GET /api/v2/search`](https://docs.joinmastodon.org/methods/search/) From e28a0ed59c39bc3b4884318fd65b86fead804532 Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Wed, 22 Feb 2023 20:55:52 -0500 Subject: [PATCH 02/15] Add Dislike Friendica API documentation --- doc/API-Friendica.md | 121 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) diff --git a/doc/API-Friendica.md b/doc/API-Friendica.md index 8460fd4ab6..4e640c2889 100644 --- a/doc/API-Friendica.md +++ b/doc/API-Friendica.md @@ -715,6 +715,127 @@ General description of profile data in API returns: --- +### POST api/friendica/statuses/:id/dislike + +Marks the given status as disliked by this user + +#### Path Parameter + +* `id`: the status ID that is being marked + +#### Return values + +A Mastodon [Status Entity](https://docs.joinmastodon.org/entities/Status/) + +#### Example: +`https:///api/friendica/statuses/341/dislike` + +```json +{ + "id": "341", + "created_at": "2023-02-23T01:50:00.000Z", + "in_reply_to_id": null, + "in_reply_to_status": null, + "in_reply_to_account_id": null, + "sensitive": false, + "spoiler_text": "", + "visibility": "public", + "language": "en", + ... + "account": { + "id": "8", + "username": "testuser2", + ... + }, + "media_attachments": [], + "mentions": [], + "tags": [], + "emojis": [], + "card": null, + "poll": null, + "friendica": { + "title": "", + "dislikes_count": 1 + } +} +``` + + +### GET api/friendica/statuses/:id/disliked_by + +Returns the list of accounts that have disliked the status as known by the current server + +#### Path Parameter + +* `id`: the status ID that is being marked + +#### Return values + +A list of [Mastodon Account](https://docs.joinmastodon.org/entities/Account/) objects +in the body and next/previous link headers in the header + +#### Example: +`https:///api/friendica/statuses/341/disliked_by` + +```json +[ + { + "id": "6", + "username": "testuser1", + ... + } +] +``` + + + +### POST api/friendica/statuses/:id/undislike + +Removes the dislike mark (if it exists) on this status for this user + +#### Path Parameter + +* `id`: the status ID that is being marked + +#### Return values + +A Mastodon [Status Entity](https://docs.joinmastodon.org/entities/Status/) + +#### Example: +`https:///api/friendica/statuses/341/dislike` + +```json +{ + "id": "341", + "created_at": "2023-02-23T01:50:00.000Z", + "in_reply_to_id": null, + "in_reply_to_status": null, + "in_reply_to_account_id": null, + "sensitive": false, + "spoiler_text": "", + "visibility": "public", + "language": "en", + ... + "account": { + "id": "8", + "username": "testuser2", + ... + }, + "media_attachments": [], + "mentions": [], + "tags": [], + "emojis": [], + "card": null, + "poll": null, + "friendica": { + "title": "", + "dislikes_count": 0 + } +} +``` + +--- + ## Deprecated endpoints - POST api/statuses/mediap From dacda1b3647c366cba91a065ebe6264ae968e68f Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Wed, 22 Feb 2023 21:31:07 -0500 Subject: [PATCH 03/15] Add changes to the Photo entries in Friendica API endpoint --- doc/API-Entities.md | 67 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/doc/API-Entities.md b/doc/API-Entities.md index 23fc2cec48..6c3e94a39b 100644 --- a/doc/API-Entities.md +++ b/doc/API-Entities.md @@ -908,6 +908,13 @@ Identical to [the Twitter Media Object](https://developer.twitter.com/en/docs/tw Resource ID (32 hex chars) + +media-id +String (Integer) +ID used for attaching to a Mastodon Post Status + + + created String (Date) @@ -1001,6 +1008,14 @@ Mutually exclusive with data datasize. + +scales +Array of Photo Scales + +List of Scale objects listing the id, scale, link, etc. of each scale + + + datasize Integer @@ -1040,6 +1055,58 @@ Mutually exclusive with link. +## Photo Scale + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeNullable
idString (Integer)Row ID of this photo scale
scaleIntegerScale number
linkString (URL)URL to this scale's image
heightIntegerImage height in pixels
widthIntegerImage width in pixels
sizeIntegerImage size in bytes
+ + ## Photo List Item From 467193c661cdb273151831efca0079503216e177 Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Wed, 22 Feb 2023 21:49:56 -0500 Subject: [PATCH 04/15] Add Mastodon Status Entity Friendica extensions (minus quote) - I can't figure out how to get the quote one to populate, check if still relevant --- doc/API-Mastodon.md | 60 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/doc/API-Mastodon.md b/doc/API-Mastodon.md index dc068202fa..fe2e77f103 100644 --- a/doc/API-Mastodon.md +++ b/doc/API-Mastodon.md @@ -29,7 +29,65 @@ 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/). +These endpoints use the [Mastodon API entities](https://docs.joinmastodon.org/entities/). With some additional extensions listed below. + +### Status Entities +Extensions to the [Mastodon Status Entities](https://docs.joinmastodon.org/entities/Status/) +* `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 + * `dislikes_count`: The number of dislikes that a status has accumulated according to the server. + +Example: +```json +{ + "id": "358", + "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 + } + }, + "in_reply_to_account_id": "6", + ... + "replies_count": 0, + "reblogs_count": 0, + "favourites_count": 0, + ... + "content": "A reply from testuser2", + ... + "account": { + "id": "8", + "username": "testuser2", + "acct": "testuser2", + "display_name": "testuser2", + ... + }, + ... + "friendica": { + "title": "", + "dislikes_count": 0 + } +} +``` ## Implemented endpoints From e0143618db3523574600e3a6313accdda10e6b46 Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Wed, 22 Feb 2023 22:07:27 -0500 Subject: [PATCH 05/15] Add Mastodon API endpoint extension information --- doc/API-Mastodon.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/API-Mastodon.md b/doc/API-Mastodon.md index fe2e77f103..932446b198 100644 --- a/doc/API-Mastodon.md +++ b/doc/API-Mastodon.md @@ -150,6 +150,10 @@ 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 `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 - [`GET /api/v1/notifications/:id`](https://docs.joinmastodon.org/methods/notifications/) - [`POST /api/v1/notifications/clear`](https://docs.joinmastodon.org/methods/notifications/) - [`POST /api/v1/notifications/:id/dismiss`](https://docs.joinmastodon.org/methods/notifications/) @@ -166,9 +170,15 @@ Example: - [`GET /api/v1/search`](https://docs.joinmastodon.org/methods/search/) - [`POST /api/v1/statuses`](https://docs.joinmastodon.org/methods/statuses/#create) - 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: + - `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 `""`. - [`GET /api/v1/statuses/:id`](https://docs.joinmastodon.org/methods/statuses/#get) - [`DELETE /api/v1/statuses/:id`](https://docs.joinmastodon.org/methods/statuses/#delete) - [`GET /api/v1/statuses/:id/context`](https://docs.joinmastodon.org/methods/statuses/#context) + - Additional support for paging using `min_id`, `max_id`, `since_id` parameters + - Additional support for previous/next Link Headers to support paging + - Additional flag `show_all` to allow including posts from blocked and ignored/muted users, defaults to `false` - [`GET /api/v1/statuses/:id/reblogged_by`](https://docs.joinmastodon.org/methods/statuses/#reblogged_by) - [`GET /api/v1/statuses/:id/favourited_by`](https://docs.joinmastodon.org/methods/statuses/#favourited_by) - [`POST /api/v1/statuses/:id/favourite`](https://docs.joinmastodon.org/methods/statuses/#favourite) @@ -197,6 +207,7 @@ Example: - [`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` - [`GET /api/v2/instance`](https://docs.joinmastodon.org/methods/instance/#v2) - [`GET /api/v2/search`](https://docs.joinmastodon.org/methods/search/) From a8661f1effa85c30d83624b0b0d1d750310c7383 Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Wed, 22 Feb 2023 22:20:33 -0500 Subject: [PATCH 06/15] Add Mastodon Notification Entity Extensions documentation --- doc/API-Mastodon.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/API-Mastodon.md b/doc/API-Mastodon.md index 932446b198..94068dab64 100644 --- a/doc/API-Mastodon.md +++ b/doc/API-Mastodon.md @@ -31,6 +31,10 @@ For supported apps please have a look at the [FAQ](help/FAQ#clients) These endpoints use the [Mastodon API entities](https://docs.joinmastodon.org/entities/). With some additional extensions listed below. +### Notification Entities +Extensions to the [Mastodon Notification Entities](https://docs.joinmastodon.org/entities/Notification/) +* `dismissed`: whether the object has been dismissed or not + ### Status Entities Extensions to the [Mastodon Status Entities](https://docs.joinmastodon.org/entities/Status/) * `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 From d64ae9bef2a93591020b15014a4918c20780e5f8 Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Wed, 22 Feb 2023 22:35:24 -0500 Subject: [PATCH 07/15] Add new Friendica Photo Album GET endpoints to documentation --- doc/API-Entities.md | 34 +++++++++++++++++ doc/API-Friendica.md | 88 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 120 insertions(+), 2 deletions(-) diff --git a/doc/API-Entities.md b/doc/API-Entities.md index 6c3e94a39b..0242f4ab0a 100644 --- a/doc/API-Entities.md +++ b/doc/API-Entities.md @@ -1170,6 +1170,40 @@ Mutually exclusive with link.
+ +## Photo Album + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
nameStringThe name of the photo album
createdString (Date)The creation date of the album. Format YYYY-MM-DD HH:MM:SS
countIntegerThe number of images in the album
+ ## Private message diff --git a/doc/API-Friendica.md b/doc/API-Friendica.md index 4e640c2889..ea11c793a8 100644 --- a/doc/API-Friendica.md +++ b/doc/API-Friendica.md @@ -665,8 +665,8 @@ On success: ```json { - "result": "updated", - "message":"album 'abc' with all containing photos has been renamed to 'xyz'." + "result": "updated", + "message":"album 'abc' with all containing photos has been renamed to 'xyz'." } ``` @@ -676,8 +676,92 @@ On error: * 400 BADREQUEST: "no albumname specified", "no new albumname specified", "album not available" * 500 INTERNALSERVERERROR: "unknown error - updating in database failed" +### GET api/friendica/photoalbums + +Get a list of photo albums for the user + +#### Parameters + +None +#### Return values + +On success a list of photo album objects: + +```json +[ + { + "name": "Wall Photos", + "created": "2023-01-22 02:03:19", + "count": 4 + }, + { + "name": "Profile photos", + "created": "2022-11-20 14:40:06", + "count": 1 + } +] +``` + +### GET api/friendica/photoalbum + +Get a list of images in a photo album +#### Parameters + +* `album` (Required): name of the album to be deleted +* `limit` (Optional): Maximum number of items to get, defaults to 50, max 500 +* `offset`(Optional): Offset in results to page through total items, defaults to 0 +* `latest_first` (Optional): Reverse the order so the most recent images are first, defaults to false + +#### Return values + +On success: + +* JSON return with the list of Photo items + +**Example:** +`https:///api/friendica/photoalbum?album=Wall Photos&limit=10&offset=2` + +```json +[ + { + "created": "2023-02-14 14:31:06", + "edited": "2023-02-14 14:31:14", + "title": "", + "desc": "", + "album": "Wall Photos", + "filename": "image.png", + "type": "image/png", + "height": 835, + "width": 693, + "datasize": 119523, + "profile": 0, + "allow_cid": "", + "deny_cid": "", + "allow_gid": "", + "deny_gid": "", + "id": "899184972463eb9b2ae3dc2580502826", + "scale": 0, + "media-id": 52, + "scales": [ + { + "id": 52, + "scale": 0, + "link": "https:///photo/899184972463eb9b2ae3dc2580502826-0.png", + "width": 693, + "height": 835, + "size": 119523 + }, + ... + ], + "thumb": "https:///photo/899184972463eb9b2ae3dc2580502826-2.png" + }, + ... +] +``` + --- + ### GET api/friendica/profile/show Returns the [Profile](help/API-Entities#Profile) data of the authenticated user. From 3389a1755305bb161957a0ca3235341b39021fea Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Wed, 22 Feb 2023 22:43:32 -0500 Subject: [PATCH 08/15] Add additional and not supported fields/QPs on the Mastodon Timeline Endpoints --- doc/API-Mastodon.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/API-Mastodon.md b/doc/API-Mastodon.md index 94068dab64..0383d89492 100644 --- a/doc/API-Mastodon.md +++ b/doc/API-Mastodon.md @@ -204,9 +204,18 @@ 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 `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` - [`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` - [`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` + - 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) From 811d57cb6d8a21c54cb76468d755012c595c35f1 Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Wed, 22 Feb 2023 22:55:04 -0500 Subject: [PATCH 09/15] Add Mastodon Status Editing endpoint documentation --- doc/API-Mastodon.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/API-Mastodon.md b/doc/API-Mastodon.md index 0383d89492..17c6ea8fe3 100644 --- a/doc/API-Mastodon.md +++ b/doc/API-Mastodon.md @@ -172,7 +172,12 @@ Example: - [`DELETE /api/v1/scheduled_statuses/:id`](https://docs.joinmastodon.org/methods/statuses/scheduled_statuses/) - [`GET /api/v1/scheduled_statuses/:id`](https://docs.joinmastodon.org/methods/statuses/scheduled_statuses/) - [`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 `""`. - [`POST /api/v1/statuses`](https://docs.joinmastodon.org/methods/statuses/#create) + - 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: From 7b6cb7bcf2e07818bcb1ab6ef2c405d24ebede4c Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Thu, 23 Feb 2023 06:46:43 -0500 Subject: [PATCH 10/15] Add Mastodon Instance::V2 Friendica extension documentation --- doc/API-Mastodon.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/doc/API-Mastodon.md b/doc/API-Mastodon.md index 17c6ea8fe3..4fa41e36ca 100644 --- a/doc/API-Mastodon.md +++ b/doc/API-Mastodon.md @@ -31,6 +31,28 @@ For supported apps please have a look at the [FAQ](help/FAQ#clients) 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/) * `dismissed`: whether the object has been dismissed or not From b243df5125e7c78ba89c918f07b2032c2913046c Mon Sep 17 00:00:00 2001 From: Hank G Date: Thu, 23 Feb 2023 10:32:09 -0500 Subject: [PATCH 11/15] Update doc/API-Entities.md Co-authored-by: Hypolite Petovan --- doc/API-Entities.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/API-Entities.md b/doc/API-Entities.md index 0242f4ab0a..473f95f9dc 100644 --- a/doc/API-Entities.md +++ b/doc/API-Entities.md @@ -911,7 +911,7 @@ Identical to [the Twitter Media Object](https://developer.twitter.com/en/docs/tw - + From 65dedb7a7eea294484143976c983255d573f4e1e Mon Sep 17 00:00:00 2001 From: Hank G Date: Thu, 23 Feb 2023 20:40:43 -0500 Subject: [PATCH 12/15] Apply suggestions from code review Changes suggested by @MrPetovan Co-authored-by: Hypolite Petovan --- doc/API-Entities.md | 2 +- doc/API-Mastodon.md | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/doc/API-Entities.md b/doc/API-Entities.md index 473f95f9dc..213b2494f1 100644 --- a/doc/API-Entities.md +++ b/doc/API-Entities.md @@ -1012,7 +1012,7 @@ Mutually exclusive with data datasize. diff --git a/doc/API-Mastodon.md b/doc/API-Mastodon.md index 4fa41e36ca..7496dc243d 100644 --- a/doc/API-Mastodon.md +++ b/doc/API-Mastodon.md @@ -29,12 +29,13 @@ 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 + * `version`: The Friendica version string * `codename`: The Friendica version code name * `db_version`: The database schema version number @@ -176,7 +177,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 @@ -196,10 +197,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: @@ -231,7 +232,7 @@ 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` @@ -240,14 +241,14 @@ Example: - 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/) From 671fc61ef4da059b6aacdc3605f7760ca652bb05 Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Thu, 23 Feb 2023 20:52:16 -0500 Subject: [PATCH 13/15] Make indentation consistent --- doc/API-Mastodon.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/API-Mastodon.md b/doc/API-Mastodon.md index 7496dc243d..a78bfc261b 100644 --- a/doc/API-Mastodon.md +++ b/doc/API-Mastodon.md @@ -235,11 +235,11 @@ Example: - 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` From 5e8acbf5342fe2fa9610b5ec978cdd9cee8a5e68 Mon Sep 17 00:00:00 2001 From: Hank G Date: Fri, 24 Feb 2023 08:46:52 -0500 Subject: [PATCH 14/15] Apply suggestions from code review Co-authored-by: Hypolite Petovan --- doc/API-Friendica.md | 78 ++++++++++++++++++++++---------------------- doc/API-Mastodon.md | 54 +++++++++++++++--------------- 2 files changed, 66 insertions(+), 66 deletions(-) diff --git a/doc/API-Friendica.md b/doc/API-Friendica.md index ea11c793a8..052754e048 100644 --- a/doc/API-Friendica.md +++ b/doc/API-Friendica.md @@ -724,36 +724,36 @@ On success: ```json [ { - "created": "2023-02-14 14:31:06", - "edited": "2023-02-14 14:31:14", - "title": "", - "desc": "", - "album": "Wall Photos", - "filename": "image.png", - "type": "image/png", - "height": 835, - "width": 693, - "datasize": 119523, - "profile": 0, - "allow_cid": "", - "deny_cid": "", - "allow_gid": "", - "deny_gid": "", - "id": "899184972463eb9b2ae3dc2580502826", - "scale": 0, - "media-id": 52, - "scales": [ - { - "id": 52, - "scale": 0, - "link": "https:///photo/899184972463eb9b2ae3dc2580502826-0.png", - "width": 693, - "height": 835, - "size": 119523 - }, - ... - ], - "thumb": "https:///photo/899184972463eb9b2ae3dc2580502826-2.png" + "created": "2023-02-14 14:31:06", + "edited": "2023-02-14 14:31:14", + "title": "", + "desc": "", + "album": "Wall Photos", + "filename": "image.png", + "type": "image/png", + "height": 835, + "width": 693, + "datasize": 119523, + "profile": 0, + "allow_cid": "", + "deny_cid": "", + "allow_gid": "", + "deny_gid": "", + "id": "899184972463eb9b2ae3dc2580502826", + "scale": 0, + "media-id": 52, + "scales": [ + { + "id": 52, + "scale": 0, + "link": "https:///photo/899184972463eb9b2ae3dc2580502826-0.png", + "width": 693, + "height": 835, + "size": 119523 + }, + ... + ], + "thumb": "https:///photo/899184972463eb9b2ae3dc2580502826-2.png" }, ... ] @@ -825,11 +825,11 @@ A Mastodon [Status Entity](https://docs.joinmastodon.org/entities/Status/) "spoiler_text": "", "visibility": "public", "language": "en", - ... + ... "account": { "id": "8", "username": "testuser2", - ... + ... }, "media_attachments": [], "mentions": [], @@ -863,11 +863,11 @@ in the body and next/previous link headers in the header ```json [ - { - "id": "6", - "username": "testuser1", - ... - } + { + "id": "6", + "username": "testuser1", + ... + } ] ``` @@ -899,11 +899,11 @@ A Mastodon [Status Entity](https://docs.joinmastodon.org/entities/Status/) "spoiler_text": "", "visibility": "public", "language": "en", - ... + ... "account": { "id": "8", "username": "testuser2", - ... + ... }, "media_attachments": [], "mentions": [], diff --git a/doc/API-Mastodon.md b/doc/API-Mastodon.md index a78bfc261b..0d7f921a27 100644 --- a/doc/API-Mastodon.md +++ b/doc/API-Mastodon.md @@ -72,26 +72,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", ... @@ -102,16 +102,16 @@ 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": "", + "dislikes_count": 0 } } ``` From c0741be417cbf0fe5858d9da7b7b0a0f9435055b Mon Sep 17 00:00:00 2001 From: Hank G Date: Fri, 24 Feb 2023 08:47:37 -0500 Subject: [PATCH 15/15] Apply suggestions from code review Co-authored-by: Hypolite Petovan --- doc/API-Friendica.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/API-Friendica.md b/doc/API-Friendica.md index 052754e048..a33cd53b86 100644 --- a/doc/API-Friendica.md +++ b/doc/API-Friendica.md @@ -690,14 +690,14 @@ On success a list of photo album objects: ```json [ { - "name": "Wall Photos", - "created": "2023-01-22 02:03:19", - "count": 4 + "name": "Wall Photos", + "created": "2023-01-22 02:03:19", + "count": 4 }, { - "name": "Profile photos", - "created": "2022-11-20 14:40:06", - "count": 1 + "name": "Profile photos", + "created": "2022-11-20 14:40:06", + "count": 1 } ] ```
media-id String (Integer) ID used for attaching to a Mastodon Post StatusID used for attaching images to a Mastodon Post Status
scales Array of Photo Scales -List of Scale objects listing the id, scale, link, etc. of each scale +List of the various resized versions of the Photo