aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/index.rst25
1 files changed, 23 insertions, 2 deletions
diff --git a/docs/index.rst b/docs/index.rst
index 9c669d5..dfd91ab 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -98,8 +98,8 @@ next page) item of the returned list as _pagination_prev and _pagination_next.
98There are convenience functions available for fetching the previous and next page of 98There are convenience functions available for fetching the previous and next page of
99a paginated request as well as for fetching all pages starting from a first page. 99a paginated request as well as for fetching all pages starting from a first page.
100 100
101A note about IDs 101Two notes about IDs
102---------------- 102-------------------
103Mastodons API uses IDs in several places: User IDs, Toot IDs, ... 103Mastodons API uses IDs in several places: User IDs, Toot IDs, ...
104 104
105While debugging, it might be tempting to copy-paste in IDs from the 105While debugging, it might be tempting to copy-paste in IDs from the
@@ -107,6 +107,23 @@ web interface into your code. This will not work, as the IDs on the web
107interface and in the URLs are not the same as the IDs used internally 107interface and in the URLs are not the same as the IDs used internally
108in the API, so don't do that. 108in the API, so don't do that.
109 109
110ID unpacking
111~~~~~~~~~~~~
112Wherever Mastodon.py expects an ID as a parameter, you can also pass a
113dict that contains an id - this means that, for example, instead of saying
114
115.. code-block:: python
116
117 mastodon.status_post("@somebody wow!", in_reply_to_id = toot["id"])
118
119you can also just write
120
121.. code-block:: python
122
123 mastodon.status_post("@somebody wow!", in_reply_to_id = toot)
124
125and everything will work as intended.
126
110Error handling 127Error handling
111-------------- 128--------------
112When Mastodon.py encounters an error, it will raise an exception, generally with 129When Mastodon.py encounters an error, it will raise an exception, generally with
@@ -377,6 +394,10 @@ init(), or the version you specified. With these functions, you can make
377Mastodon.py re-check the server version or explicitly determine if a 394Mastodon.py re-check the server version or explicitly determine if a
378specific minimum Version is available. 395specific minimum Version is available.
379 396
397Note that the automatic version checks check for the version in which the
398endpoint was first added, not the version in which it was last changed. The
399latter check may be added to Mastodon.py at a later date.
400
380.. automethod:: Mastodon.retrieve_mastodon_version 401.. automethod:: Mastodon.retrieve_mastodon_version
381.. automethod:: Mastodon.verify_minimum_version 402.. automethod:: Mastodon.verify_minimum_version
382 403
Powered by cgit v1.2.3 (git 2.41.0)