From f7603fb504236be17597e8424106877e3ba50b4e Mon Sep 17 00:00:00 2001 From: Ivan Habunek Date: Tue, 22 Nov 2022 10:41:48 +0100 Subject: [PATCH] Add api endpoint for fetching a single status --- toot/api.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/toot/api.py b/toot/api.py index 78169c6..6dab0a6 100644 --- a/toot/api.py +++ b/toot/api.py @@ -128,8 +128,8 @@ def post_status( content_type=None, ): """ - Posts a new status. - https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#posting-a-new-status + Publish a new status. + https://docs.joinmastodon.org/methods/statuses/#create """ # Idempotency key assures the same status is not posted multiple times @@ -153,6 +153,14 @@ def post_status( return http.post(app, user, '/api/v1/statuses', params, headers=headers).json() +def fetch_status(app, user, id): + """ + Fetch a single status + https://docs.joinmastodon.org/methods/statuses/#get + """ + return http.get(app, user, f"/api/v1/statuses/{id}").json() + + def delete_status(app, user, status_id): """ Deletes a status with given ID.