Add api endpoint for fetching a single status

This commit is contained in:
Ivan Habunek 2022-11-22 10:41:48 +01:00
parent 44be9fd8bb
commit 5c10479d65
No known key found for this signature in database
GPG Key ID: CDBD63C43A30BB95
1 changed files with 10 additions and 2 deletions

View File

@ -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', json=json, 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.