1
0
mirror of https://github.com/ihabunek/toot.git synced 2024-11-03 04:17:21 -05:00

Add api endpoint for fetching a single status

This commit is contained in:
Ivan Habunek 2022-11-22 10:41:48 +01:00
parent 1721558875
commit f7603fb504
No known key found for this signature in database
GPG Key ID: CDBD63C43A30BB95

View File

@ -128,8 +128,8 @@ def post_status(
content_type=None, content_type=None,
): ):
""" """
Posts a new status. Publish a new status.
https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#posting-a-new-status https://docs.joinmastodon.org/methods/statuses/#create
""" """
# Idempotency key assures the same status is not posted multiple times # 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() 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): def delete_status(app, user, status_id):
""" """
Deletes a status with given ID. Deletes a status with given ID.