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:
parent
1721558875
commit
f7603fb504
12
toot/api.py
12
toot/api.py
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user