mirror of
https://github.com/ihabunek/toot
synced 2025-02-14 02:50:39 +01:00
Add api endpoint for fetching a single status
This commit is contained in:
parent
44be9fd8bb
commit
5c10479d65
12
toot/api.py
12
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', 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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user