X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=doc%2FAPI-Friendica.md;h=a33cd53b86faba53252f2bfa1af63a26f66e5bb8;hb=64b40254b001ee69e9b040680f4cc632405cffce;hp=8460fd4ab6a9f2a80aed4414b2e34d3dbbf793ad;hpb=a10f55bb85b503c098ea1642adf4e9bda26e6746;p=friendica.git diff --git a/doc/API-Friendica.md b/doc/API-Friendica.md index 8460fd4ab6..a33cd53b86 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. @@ -715,6 +799,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