From 3601f03147bd104f6acff64e7c8d5d4d3e1f53a2 Mon Sep 17 00:00:00 2001 From: Alex S Date: Mon, 1 Apr 2019 17:17:57 +0700 Subject: Adding tag to emoji ets table changes in apis --- docs/api/pleroma_api.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/api') diff --git a/docs/api/pleroma_api.md b/docs/api/pleroma_api.md index 478c9d874..2e8fb04d2 100644 --- a/docs/api/pleroma_api.md +++ b/docs/api/pleroma_api.md @@ -10,7 +10,7 @@ Request parameters can be passed via [query strings](https://en.wikipedia.org/wi * Authentication: not required * Params: none * Response: JSON -* Example response: `{"kalsarikannit_f":"/finmoji/128px/kalsarikannit_f-128.png","perkele":"/finmoji/128px/perkele-128.png","blobdab":"/emoji/blobdab.png","happiness":"/finmoji/128px/happiness-128.png"}` +* Example response: `[{"kalsarikannit_f":{"tags":["Finmoji"],"image_url":"/finmoji/128px/kalsarikannit_f-128.png"}},{"perkele":{"tags":["Finmoji"],"image_url":"/finmoji/128px/perkele-128.png"}},{"blobdab":{"tags":["SomeTag"],"image_url":"/emoji/blobdab.png"}},"happiness":{"tags":["Finmoji"],"image_url":"/finmoji/128px/happiness-128.png"}}]` * Note: Same data as Mastodon API’s `/api/v1/custom_emojis` but in a different format ## `/api/pleroma/follow_import` @@ -27,14 +27,14 @@ Request parameters can be passed via [query strings](https://en.wikipedia.org/wi * Method: `GET` * Authentication: not required * Params: none -* Response: Provider specific JSON, the only guaranteed parameter is `type` +* Response: Provider specific JSON, the only guaranteed parameter is `type` * Example response: `{"type": "kocaptcha", "token": "whatever", "url": "https://captcha.kotobank.ch/endpoint"}` ## `/api/pleroma/delete_account` ### Delete an account * Method `POST` * Authentication: required -* Params: +* Params: * `password`: user's password * Response: JSON. Returns `{"status": "success"}` if the deletion was successful, `{"error": "[error message]"}` otherwise * Example response: `{"error": "Invalid password."}` -- cgit v1.2.3 From 5564cd421dfc706208df0b7447b0d692dffe052e Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Thu, 4 Apr 2019 12:19:31 -0500 Subject: Document Prometheus --- docs/api/prometheus.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 docs/api/prometheus.md (limited to 'docs/api') diff --git a/docs/api/prometheus.md b/docs/api/prometheus.md new file mode 100644 index 000000000..19c564e3c --- /dev/null +++ b/docs/api/prometheus.md @@ -0,0 +1,22 @@ +# Prometheus Metrics + +Pleroma includes support for exporting metrics via the [prometheus_ex](https://github.com/deadtrickster/prometheus.ex) library. + +## `/api/pleroma/app_metrics` +### Exports Prometheus application metrics +* Method: `GET` +* Authentication: not required +* Params: none +* Response: JSON + +## Grafana +### Config example +The following is a config example to use with [Grafana](https://grafana.com) + +``` + - job_name: 'beam' + metrics_path: /api/pleroma/app_metrics + scheme: https + static_configs: + - targets: ['pleroma.soykaf.com'] +``` -- cgit v1.2.3 From 4a6855d9eedf07159520b2205c554c891e70c7d4 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sun, 1 Jan 2017 03:10:08 +0300 Subject: Provide plaintext representations of content/cw in MastoAPI --- docs/api/differences_in_mastoapi_responses.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs/api') diff --git a/docs/api/differences_in_mastoapi_responses.md b/docs/api/differences_in_mastoapi_responses.md index 215f43155..923d94db2 100644 --- a/docs/api/differences_in_mastoapi_responses.md +++ b/docs/api/differences_in_mastoapi_responses.md @@ -20,6 +20,8 @@ Has these additional fields under the `pleroma` object: - `local`: true if the post was made on the local instance. - `conversation_id`: the ID of the conversation the status is associated with (if any) +- `content`: a map consisting of alternate representations of the `content` property with the key being it's mimetype. Currently the only alternate representation supported is `text/plain` +- `spoiler_text`: a map consisting of alternate representations of the `spoiler_text` property with the key being it's mimetype. Currently the only alternate representation supported is `text/plain` ## Attachments -- cgit v1.2.3 From dfae0050af385786c5799ee886de315f69d36a78 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Thu, 28 Mar 2019 19:46:30 +0300 Subject: Move out of Gitlab Wiki I understand that this change is quite unreadable and hard to review, sorry for forgetting to do atomic commits. This patch does not change too much content wise, it just * Gets everything from gitlab wiki * Removes some specific gitlab hacks * Formats all documentation file names to be in snake case so they look the same way as our code does --- docs/api/admin_api.md | 194 ++++++++++++++++++++++++++ docs/api/differences_in_mastoapi_responses.md | 46 ++++++ docs/api/pleroma_api.md | 121 ++++++++++++++++ 3 files changed, 361 insertions(+) create mode 100644 docs/api/admin_api.md create mode 100644 docs/api/differences_in_mastoapi_responses.md create mode 100644 docs/api/pleroma_api.md (limited to 'docs/api') diff --git a/docs/api/admin_api.md b/docs/api/admin_api.md new file mode 100644 index 000000000..ea9b9308c --- /dev/null +++ b/docs/api/admin_api.md @@ -0,0 +1,194 @@ +# Admin API +# Admin API + +Authentication is required and the user must be an admin. + +## `/api/pleroma/admin/users` + +### List users + +- Method `GET` +- Query Params: + - *optional* `query`: **string** search term + - *optional* `filters`: **string** comma-separated string of filters: + - `local`: only local users + - `external`: only external users + - `active`: only active users + - `deactivated`: only deactivated users + - *optional* `page`: **integer** page number + - *optional* `page_size`: **integer** number of users per page (default is `50`) +- Example: `https://mypleroma.org/api/pleroma/admin/users?query=john&filters=local,active&page=1&page_size=10` +- Response: + +```JSON +{ + "page_size": integer, + "count": integer, + "users": [ + { + "deactivated": bool, + "id": integer, + "nickname": string, + "roles": { + "admin": bool, + "moderator": bool + }, + "local": bool, + "tags": array + }, + ... + ] +} +``` + +## `/api/pleroma/admin/user` + +### Remove a user + +- Method `DELETE` +- Params: + - `nickname` +- Response: User’s nickname + +### Create a user + +- Method: `POST` +- Params: + - `nickname` + - `email` + - `password` +- Response: User’s nickname + +## `/api/pleroma/admin/users/:nickname/toggle_activation` + +### Toggle user activation + +- Method: `PATCH` +- Params: + - `nickname` +- Response: User’s object + +```JSON +{ + "deactivated": bool, + "id": integer, + "nickname": string +} +``` + +## `/api/pleroma/admin/users/tag` + +### Tag a list of users + +- Method: `PUT` +- Params: + - `nickname` + - `tags` + +### Untag a list of users + +- Method: `DELETE` +- Params: + - `nickname` + - `tags` + +## `/api/pleroma/admin/permission_group/:nickname` + +### Get user user permission groups membership + +- Method: `GET` +- Params: none +- Response: + +```JSON +{ + "is_moderator": bool, + "is_admin": bool +} +``` + +## `/api/pleroma/admin/permission_group/:nickname/:permission_group` + +Note: Available `:permission_group` is currently moderator and admin. 404 is returned when the permission group doesn’t exist. + +### Get user user permission groups membership per permission group + +- Method: `GET` +- Params: none +- Response: + +```JSON +{ + "is_moderator": bool, + "is_admin": bool +} +``` + +### Add user in permission group + +- Method: `POST` +- Params: none +- Response: + - On failure: `{"error": "…"}` + - On success: JSON of the `user.info` + +### Remove user from permission group + +- Method: `DELETE` +- Params: none +- Response: + - On failure: `{"error": "…"}` + - On success: JSON of the `user.info` +- Note: An admin cannot revoke their own admin status. + +## `/api/pleroma/admin/activation_status/:nickname` + +### Active or deactivate a user + +- Method: `PUT` +- Params: + - `nickname` + - `status` BOOLEAN field, false value means deactivation. + +## `/api/pleroma/admin/relay` + +### Follow a Relay + +- Methods: `POST` +- Params: + - `relay_url` +- Response: + - On success: URL of the followed relay + +### Unfollow a Relay + +- Methods: `DELETE` +- Params: + - `relay_url` +- Response: + - On success: URL of the unfollowed relay + +## `/api/pleroma/admin/invite_token` + +### Get a account registeration invite token + +- Methods: `GET` +- Params: none +- Response: invite token (base64 string) + +## `/api/pleroma/admin/email_invite` + +### Sends registration invite via email + +- Methods: `POST` +- Params: + - `email` + - `name`, optionnal + +## `/api/pleroma/admin/password_reset` + +### Get a password reset token for a given nickname + +- Methods: `GET` +- Params: none +- Response: password reset token (base64 string) diff --git a/docs/api/differences_in_mastoapi_responses.md b/docs/api/differences_in_mastoapi_responses.md new file mode 100644 index 000000000..d993d1383 --- /dev/null +++ b/docs/api/differences_in_mastoapi_responses.md @@ -0,0 +1,46 @@ +# Differences in Mastodon API responses from vanilla Mastodon + +A Pleroma instance can be identified by " (compatible; Pleroma )" present in `version` field in response from `/api/v1/instance` + +## Flake IDs + +Pleroma uses 128-bit ids as opposed to Mastodon's 64 bits. However just like Mastodon's ids they are sortable strings + +## Attachment cap + +Some apps operate under the assumption that no more than 4 attachments can be returned or uploaded. Pleroma however does not enforce any limits on attachment count neither when returning the status object nor when posting. + +## Timelines + +Adding the parameter `with_muted=true` to the timeline queries will also return activities by muted (not by blocked!) users. + +## Statuses + +Has these additional fields under the `pleroma` object: + +- `local`: true if the post was made on the local instance. +- `conversation_id`: the ID of the conversation the status is associated with (if any) + +## Attachments + +Has these additional fields under the `pleroma` object: + +- `mime_type`: mime type of the attachment. + +## Accounts + +- `/api/v1/accounts/:id`: The `id` parameter can also be the `nickname` of the user. This only works in this endpoint, not the deeper nested ones for following etc. + +Has these additional fields under the `pleroma` object: + +- `tags`: Lists an array of tags for the user +- `relationship{}`: Includes fields as documented for Mastodon API https://docs.joinmastodon.org/api/entities/#relationship +- `is_moderator`: boolean, true if user is a moderator +- `is_admin`: boolean, true if user is an admin +- `confirmation_pending`: boolean, true if a new user account is waiting on email confirmation to be activated + +## Notifications + +Has these additional fields under the `pleroma` object: + +- `is_seen`: true if the notification was read by the user diff --git a/docs/api/pleroma_api.md b/docs/api/pleroma_api.md new file mode 100644 index 000000000..bd3fcaa5d --- /dev/null +++ b/docs/api/pleroma_api.md @@ -0,0 +1,121 @@ +# Pleroma API + +Requests that require it can be authenticated with [an OAuth token](https://tools.ietf.org/html/rfc6749), the `_pleroma_key` cookie, or [HTTP Basic Authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). + +Request parameters can be passed via [query strings](https://en.wikipedia.org/wiki/Query_string) or as [form data](https://www.w3.org/TR/html401/interact/forms.html). Files must be uploaded as `multipart/form-data`. + +## `/api/pleroma/emoji` +### Lists the custom emoji on that server. +* Method: `GET` +* Authentication: not required +* Params: none +* Response: JSON +* Example response: `{"kalsarikannit_f":"/finmoji/128px/kalsarikannit_f-128.png","perkele":"/finmoji/128px/perkele-128.png","blobdab":"/emoji/blobdab.png","happiness":"/finmoji/128px/happiness-128.png"}` +* Note: Same data as Mastodon API’s `/api/v1/custom_emojis` but in a different format + +## `/api/pleroma/follow_import` +### Imports your follows, for example from a Mastodon CSV file. +* Method: `POST` +* Authentication: required +* Params: + * `list`: STRING or FILE containing a whitespace-separated list of accounts to follow +* Response: HTTP 200 on success, 500 on error +* Note: Users that can't be followed are silently skipped. + +## `/api/pleroma/captcha` +### Get a new captcha +* Method: `GET` +* Authentication: not required +* Params: none +* Response: Provider specific JSON, the only guaranteed parameter is `type` +* Example response: `{"type": "kocaptcha", "token": "whatever", "url": "https://captcha.kotobank.ch/endpoint"}` + +## `/api/pleroma/delete_account` +### Delete an account +* Method `POST` +* Authentication: required +* Params: + * `password`: user's password +* Response: JSON. Returns `{"status": "success"}` if the deletion was successful, `{"error": "[error message]"}` otherwise +* Example response: `{"error": "Invalid password."}` + +## `/api/account/register` +### Register a new user +* Method `POST` +* Authentication: not required +* Params: + * `nickname` + * `fullname` + * `bio` + * `email` + * `password` + * `confirm` + * `captcha_solution`: optional, contains provider-specific captcha solution, + * `captcha_token`: optional, contains provider-specific captcha token + * `token`: invite token required when the registerations aren't public. +* Response: JSON. Returns a user object on success, otherwise returns `{"error": "error_msg"}` +* Example response: +``` +{ + "background_image": null, + "cover_photo": "https://pleroma.soykaf.com/images/banner.png", + "created_at": "Tue Dec 18 16:55:56 +0000 2018", + "default_scope": "public", + "description": "blushy-crushy fediverse idol + pleroma dev +let's be friends +ぷれろまの生徒会長。謎の外人。日本語OK. +公主病.", + "description_html": "blushy-crushy fediverse idol + pleroma dev.
let's be friends
ぷれろまの生徒会長。謎の外人。日本語OK.
公主病.", + "favourites_count": 0, + "fields": [], + "followers_count": 0, + "following": false, + "follows_you": false, + "friends_count": 0, + "id": 6, + "is_local": true, + "locked": false, + "name": "lain", + "name_html": "lain", + "no_rich_text": false, + "pleroma": { + "tags": [] + }, + "profile_image_url": "https://pleroma.soykaf.com/images/avi.png", + "profile_image_url_https": "https://pleroma.soykaf.com/images/avi.png", + "profile_image_url_original": "https://pleroma.soykaf.com/images/avi.png", + "profile_image_url_profile_size": "https://pleroma.soykaf.com/images/avi.png", + "rights": { + "delete_others_notice": false + }, + "screen_name": "lain", + "statuses_count": 0, + "statusnet_blocking": false, + "statusnet_profile_url": "https://pleroma.soykaf.com/users/lain" +} +``` + +## `/api/pleroma/admin/`… +See [Admin-API](Admin-API.md) + +## `/api/v1/pleroma/flavour/:flavour` +* Method `POST` +* Authentication: required +* Response: JSON string. Returns the user flavour or the default one on success, otherwise returns `{"error": "error_msg"}` +* Example response: "glitch" +* Note: This is intended to be used only by mastofe + +## `/api/v1/pleroma/flavour` +* Method `GET` +* Authentication: required +* Response: JSON string. Returns the user flavour or the default one. +* Example response: "glitch" +* Note: This is intended to be used only by mastofe + +## `/api/pleroma/notifications/read` +### Mark a single notification as read +* Method `POST` +* Authentication: required +* Params: + * `id`: notifications's id +* Response: JSON. Returns `{"status": "success"}` if the reading was successful, otherwise returns `{"error": "error_msg"}` -- cgit v1.2.3 From d16e2a2e0435b2ff1ef5190279b35121180d14ca Mon Sep 17 00:00:00 2001 From: rinpatch Date: Thu, 28 Mar 2019 20:16:59 +0300 Subject: Remove duplicated header from admin_api.md --- docs/api/admin_api.md | 1 - 1 file changed, 1 deletion(-) (limited to 'docs/api') diff --git a/docs/api/admin_api.md b/docs/api/admin_api.md index ea9b9308c..84adca6ff 100644 --- a/docs/api/admin_api.md +++ b/docs/api/admin_api.md @@ -1,5 +1,4 @@ # Admin API -# Admin API Authentication is required and the user must be an admin. -- cgit v1.2.3 From 9bd80e60448e5ab1d3634d83589e8605f24d37d8 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Thu, 28 Mar 2019 20:27:01 +0300 Subject: did it really take me 4 commits to fix this? --- docs/api/pleroma_api.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'docs/api') diff --git a/docs/api/pleroma_api.md b/docs/api/pleroma_api.md index bd3fcaa5d..478c9d874 100644 --- a/docs/api/pleroma_api.md +++ b/docs/api/pleroma_api.md @@ -61,10 +61,7 @@ Request parameters can be passed via [query strings](https://en.wikipedia.org/wi "cover_photo": "https://pleroma.soykaf.com/images/banner.png", "created_at": "Tue Dec 18 16:55:56 +0000 2018", "default_scope": "public", - "description": "blushy-crushy fediverse idol + pleroma dev -let's be friends -ぷれろまの生徒会長。謎の外人。日本語OK. -公主病.", + "description": "blushy-crushy fediverse idol + pleroma dev\nlet's be friends \nぷれろまの生徒会長。謎の外人。日本語OK. \n公主病.", "description_html": "blushy-crushy fediverse idol + pleroma dev.
let's be friends
ぷれろまの生徒会長。謎の外人。日本語OK.
公主病.", "favourites_count": 0, "fields": [], -- cgit v1.2.3 From 42b779527c551595399771fbc3c0701d38a3ed3d Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 29 Mar 2019 22:15:20 +0300 Subject: document fake option --- docs/api/differences_in_mastoapi_responses.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs/api') diff --git a/docs/api/differences_in_mastoapi_responses.md b/docs/api/differences_in_mastoapi_responses.md index d993d1383..f5ce7493d 100644 --- a/docs/api/differences_in_mastoapi_responses.md +++ b/docs/api/differences_in_mastoapi_responses.md @@ -44,3 +44,9 @@ Has these additional fields under the `pleroma` object: Has these additional fields under the `pleroma` object: - `is_seen`: true if the notification was read by the user + +## POST `/api/v1/statuses` + +Additional parameters can be added to the JSON body: + +- `fake`: boolean, if set to `true` the post won't be actually posted, but the status entitiy would still be rendered back. This could be useful for previewing rich text/custom emoji, for example. -- cgit v1.2.3 From fdb4357e9ba7a34a603997d50d85593ca2bf6395 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Tue, 2 Apr 2019 14:31:18 +0300 Subject: Rename fake param to preview and make the tests check that the object was not inserted to the db --- docs/api/differences_in_mastoapi_responses.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/api') diff --git a/docs/api/differences_in_mastoapi_responses.md b/docs/api/differences_in_mastoapi_responses.md index f5ce7493d..7adf29676 100644 --- a/docs/api/differences_in_mastoapi_responses.md +++ b/docs/api/differences_in_mastoapi_responses.md @@ -49,4 +49,4 @@ Has these additional fields under the `pleroma` object: Additional parameters can be added to the JSON body: -- `fake`: boolean, if set to `true` the post won't be actually posted, but the status entitiy would still be rendered back. This could be useful for previewing rich text/custom emoji, for example. +- `preview`: boolean, if set to `true` the post won't be actually posted, but the status entitiy would still be rendered back. This could be useful for previewing rich text/custom emoji, for example. -- cgit v1.2.3 From 79cb34a4b0dd1c0ffe45e796f5ac6790e3b31025 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Tue, 2 Apr 2019 23:07:16 +0300 Subject: Fix preview not being usable in form data --- docs/api/differences_in_mastoapi_responses.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/api') diff --git a/docs/api/differences_in_mastoapi_responses.md b/docs/api/differences_in_mastoapi_responses.md index 7adf29676..215f43155 100644 --- a/docs/api/differences_in_mastoapi_responses.md +++ b/docs/api/differences_in_mastoapi_responses.md @@ -47,6 +47,6 @@ Has these additional fields under the `pleroma` object: ## POST `/api/v1/statuses` -Additional parameters can be added to the JSON body: +Additional parameters can be added to the JSON body/Form data: - `preview`: boolean, if set to `true` the post won't be actually posted, but the status entitiy would still be rendered back. This could be useful for previewing rich text/custom emoji, for example. -- cgit v1.2.3 From da64a5aece131d6bd8c0d17dcda61c626b44c4d0 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Fri, 5 Apr 2019 11:29:34 -0500 Subject: Document the admin API endpoints for controlling follow/unfollow --- docs/api/admin_api.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'docs/api') diff --git a/docs/api/admin_api.md b/docs/api/admin_api.md index 53b68ffd4..86cacebb1 100644 --- a/docs/api/admin_api.md +++ b/docs/api/admin_api.md @@ -58,6 +58,26 @@ Authentication is required and the user must be an admin. - `password` - Response: User’s nickname +## `/api/pleroma/admin/user/follow` +### Make a user follow another user + +- Methods: `POST` +- Params: + - `follower`: The nickname of the follower + - `followed`: The nickname of the followed +- Response: + - "ok" + +## `/api/pleroma/admin/user/unfollow` +### Make a user unfollow another user + +- Methods: `POST` +- Params: + - `follower`: The nickname of the follower + - `followed`: The nickname of the followed +- Response: + - "ok" + ## `/api/pleroma/admin/users/:nickname/toggle_activation` ### Toggle user activation -- cgit v1.2.3 From c05fe4da0a9ad119891d2fc6cf82ea3beb59fec7 Mon Sep 17 00:00:00 2001 From: Sadposter Date: Sat, 6 Apr 2019 16:20:06 +0100 Subject: Document subscription endpoints, fix typos Also adds a quick error case on the subscription endpoints to avoid 500s --- docs/api/pleroma_api.md | 52 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) (limited to 'docs/api') diff --git a/docs/api/pleroma_api.md b/docs/api/pleroma_api.md index 478c9d874..410f2a955 100644 --- a/docs/api/pleroma_api.md +++ b/docs/api/pleroma_api.md @@ -52,7 +52,7 @@ Request parameters can be passed via [query strings](https://en.wikipedia.org/wi * `confirm` * `captcha_solution`: optional, contains provider-specific captcha solution, * `captcha_token`: optional, contains provider-specific captcha token - * `token`: invite token required when the registerations aren't public. + * `token`: invite token required when the registrations aren't public. * Response: JSON. Returns a user object on success, otherwise returns `{"error": "error_msg"}` * Example response: ``` @@ -114,5 +114,53 @@ See [Admin-API](Admin-API.md) * Method `POST` * Authentication: required * Params: - * `id`: notifications's id + * `id`: notification's id * Response: JSON. Returns `{"status": "success"}` if the reading was successful, otherwise returns `{"error": "error_msg"}` + +## `/api/v1/pleroma/accounts/:id/subscribe` +### Subscribe to receive notifications for all statuses posted by a user +* Method `POST` +* Authentication: required +* Params: + * `id`: account id to subscribe to +* Response: JSON, returns a mastodon relationship object on success, otherwise returns `{"error": "error_msg"}` +* Example response: +```json +{ + id: "abcdefg", + following: true, + followed_by: false, + blocking: false, + muting: false, + muting_notifications: false, + subscribing: true, + requested: false, + domain_blocking: false, + showing_reblogs: true, + endorsed: false +} +``` + +## `/api/v1/pleroma/accounts/:id/unsubscribe` +### Unsubscribe to stop receiving notifications from user statuses +* Method `POST` +* Authentication: required +* Params: + * `id`: account id to unsubscribe from +* Response: JSON, returns a mastodon relationship object on success, otherwise returns `{"error": "error_msg"}` +* Example response: +```json +{ + id: "abcdefg", + following: true, + followed_by: false, + blocking: false, + muting: false, + muting_notifications: false, + subscribing: false, + requested: false, + domain_blocking: false, + showing_reblogs: true, + endorsed: false +} +``` -- cgit v1.2.3 From e6778003abcccdf35fe098a571023ed5f5a20323 Mon Sep 17 00:00:00 2001 From: Sadposter Date: Sat, 6 Apr 2019 16:24:21 +0100 Subject: JSON need quotes! --- docs/api/pleroma_api.md | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'docs/api') diff --git a/docs/api/pleroma_api.md b/docs/api/pleroma_api.md index 410f2a955..75569e092 100644 --- a/docs/api/pleroma_api.md +++ b/docs/api/pleroma_api.md @@ -127,17 +127,17 @@ See [Admin-API](Admin-API.md) * Example response: ```json { - id: "abcdefg", - following: true, - followed_by: false, - blocking: false, - muting: false, - muting_notifications: false, - subscribing: true, - requested: false, - domain_blocking: false, - showing_reblogs: true, - endorsed: false + "id": "abcdefg", + "following": true, + "followed_by": false, + "blocking": false, + "muting": false, + "muting_notifications": false, + "subscribing": true, + "requested": false, + "domain_blocking": false, + "showing_reblogs": true, + "endorsed": false } ``` @@ -151,16 +151,16 @@ See [Admin-API](Admin-API.md) * Example response: ```json { - id: "abcdefg", - following: true, - followed_by: false, - blocking: false, - muting: false, - muting_notifications: false, - subscribing: false, - requested: false, - domain_blocking: false, - showing_reblogs: true, - endorsed: false + "id": "abcdefg", + "following": true, + "followed_by": false, + "blocking": false, + "muting": false, + "muting_notifications": false, + "subscribing": false, + "requested": false, + "domain_blocking": false, + "showing_reblogs": true, + "endorsed": false } ``` -- cgit v1.2.3 From b810aac117563a941b50180f19bca2d96a329a0a Mon Sep 17 00:00:00 2001 From: Alex S Date: Sun, 7 Apr 2019 19:48:52 +0700 Subject: added docs to docs/api/admin_api.md code style and little renamings --- docs/api/admin_api.md | 59 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 3 deletions(-) (limited to 'docs/api') diff --git a/docs/api/admin_api.md b/docs/api/admin_api.md index 86cacebb1..638b235b8 100644 --- a/docs/api/admin_api.md +++ b/docs/api/admin_api.md @@ -200,12 +200,65 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret ## `/api/pleroma/admin/invite_token` -### Get a account registeration invite token +### Get an account registration invite token - Methods: `GET` -- Params: none +- Params: + - *optional* `invite` => [ + - *optional* `max_use` (integer) + - *optional* `expire_at` (date string e.g. "2019-04-07") + ] - Response: invite token (base64 string) +## `/api/pleroma/admin/invites` + +### Get a list of generated invites + +- Methods: `GET` +- Params: none +- Response: + +```JSON +{ + + "invites": [ + { + "id": integer, + "token": string, + "used": boolean, + "expire_at": date, + "uses": integer, + "max_use": integer, + "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`) + }, + ... + ] +} +``` + +## `/api/pleroma/admin/revoke_invite` + +### Revoke invite by token + +- Methods: `POST` +- Params: + - `token` +- Response: + +```JSON +{ + "id": integer, + "token": string, + "used": boolean, + "expire_at": date, + "uses": integer, + "max_use": integer, + "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`) + +} +``` + + ## `/api/pleroma/admin/email_invite` ### Sends registration invite via email @@ -213,7 +266,7 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret - Methods: `POST` - Params: - `email` - - `name`, optionnal + - `name`, optional ## `/api/pleroma/admin/password_reset` -- cgit v1.2.3 From 012bb5dcc9bfbf6f3ea210ec4e865f3adcea9dfd Mon Sep 17 00:00:00 2001 From: Alex S Date: Mon, 8 Apr 2019 16:01:28 +0700 Subject: renaming expire_at -> expires_at keyword style change --- docs/api/admin_api.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/api') diff --git a/docs/api/admin_api.md b/docs/api/admin_api.md index 638b235b8..8befa8ea0 100644 --- a/docs/api/admin_api.md +++ b/docs/api/admin_api.md @@ -206,7 +206,7 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret - Params: - *optional* `invite` => [ - *optional* `max_use` (integer) - - *optional* `expire_at` (date string e.g. "2019-04-07") + - *optional* `expires_at` (date string e.g. "2019-04-07") ] - Response: invite token (base64 string) @@ -226,7 +226,7 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret "id": integer, "token": string, "used": boolean, - "expire_at": date, + "expires_at": date, "uses": integer, "max_use": integer, "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`) @@ -250,7 +250,7 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret "id": integer, "token": string, "used": boolean, - "expire_at": date, + "expires_at": date, "uses": integer, "max_use": integer, "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`) -- cgit v1.2.3 From b57b43027cf958d3a3a82b95f155ae27b235b543 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Tue, 9 Apr 2019 23:20:31 +0300 Subject: Change response format of /api/pleroma/emoji to the one that actually makes sense --- docs/api/pleroma_api.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'docs/api') diff --git a/docs/api/pleroma_api.md b/docs/api/pleroma_api.md index 2e8fb04d2..6f2bc61bc 100644 --- a/docs/api/pleroma_api.md +++ b/docs/api/pleroma_api.md @@ -10,7 +10,29 @@ Request parameters can be passed via [query strings](https://en.wikipedia.org/wi * Authentication: not required * Params: none * Response: JSON -* Example response: `[{"kalsarikannit_f":{"tags":["Finmoji"],"image_url":"/finmoji/128px/kalsarikannit_f-128.png"}},{"perkele":{"tags":["Finmoji"],"image_url":"/finmoji/128px/perkele-128.png"}},{"blobdab":{"tags":["SomeTag"],"image_url":"/emoji/blobdab.png"}},"happiness":{"tags":["Finmoji"],"image_url":"/finmoji/128px/happiness-128.png"}}]` +* Example response: +```json +{ + "girlpower": { + "tags": [ + "Finmoji" + ], + "image_url": "/finmoji/128px/girlpower-128.png" + }, + "education": { + "tags": [ + "Finmoji" + ], + "image_url": "/finmoji/128px/education-128.png" + }, + "finnishlove": { + "tags": [ + "Finmoji" + ], + "image_url": "/finmoji/128px/finnishlove-128.png" + } +} +``` * Note: Same data as Mastodon API’s `/api/v1/custom_emojis` but in a different format ## `/api/pleroma/follow_import` -- cgit v1.2.3