aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2016-11-25 20:34:45 +0100
committerLorenz Diener <[email protected]>2016-11-25 20:34:45 +0100
commit10eda366d56ff9ea97e8509af935ddadcc5d176d (patch)
treecd2436b66eabdf7798334a943bc25020056c179d /docs/index.rst
parent3585830182215428b689738a7923121655390ae6 (diff)
downloadmastodon.py-10eda366d56ff9ea97e8509af935ddadcc5d176d.tar.gz
Note about IDs
Diffstat (limited to 'docs/index.rst')
-rw-r--r--docs/index.rst16
1 files changed, 9 insertions, 7 deletions
diff --git a/docs/index.rst b/docs/index.rst
index f388182..eb4bd27 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -39,15 +39,22 @@ as a single python module. By default, it talks to the
39`Mastodon flagship instance`_, but it can be set to talk to any 39`Mastodon flagship instance`_, but it can be set to talk to any
40node running Mastodon. 40node running Mastodon.
41 41
42A note about IDs
43----------------
44Mastodons API uses IDs in several places: User IDs, Toot IDs, ...
45
46While debugging, it might be tempting to copy-paste in IDs from the
47web interface into your code. This will not work, as the IDs on the web
48interface and in the URLs are not the same as the IDs used internally
49in the API, so don't do that.
50
42Return values 51Return values
43------------- 52-------------
44
45Unless otherwise specified, all data is returned as python 53Unless otherwise specified, all data is returned as python
46dictionaries, matching the JSON format used by the API. 54dictionaries, matching the JSON format used by the API.
47 55
48User dicts 56User dicts
49~~~~~~~~~~ 57~~~~~~~~~~
50
51.. code-block:: python 58.. code-block:: python
52 59
53 { 60 {
@@ -90,7 +97,6 @@ Toot dicts
90 97
91Relationship dicts 98Relationship dicts
92~~~~~~~~~~~~~~~~~~ 99~~~~~~~~~~~~~~~~~~
93
94.. code-block:: python 100.. code-block:: python
95 101
96 mastodon.account_follow(<numerical id>) 102 mastodon.account_follow(<numerical id>)
@@ -104,7 +110,6 @@ Relationship dicts
104 110
105Context dicts 111Context dicts
106~~~~~~~~~~~~~ 112~~~~~~~~~~~~~
107
108.. code-block:: python 113.. code-block:: python
109 114
110 mastodon.status_context(<numerical id>) 115 mastodon.status_context(<numerical id>)
@@ -116,7 +121,6 @@ Context dicts
116 121
117Media dicts 122Media dicts
118~~~~~~~~~~~ 123~~~~~~~~~~~
119
120.. code-block:: python 124.. code-block:: python
121 125
122 mastodon.media_post("image.jpg", "image/jpeg") 126 mastodon.media_post("image.jpg", "image/jpeg")
@@ -128,8 +132,6 @@ Media dicts
128 'url': The URL for the media 132 'url': The URL for the media
129 } 133 }
130 134
131
132
133App registration and user authentication 135App registration and user authentication
134---------------------------------------- 136----------------------------------------
135Before you can use the mastodon API, you have to register your 137Before you can use the mastodon API, you have to register your
Powered by cgit v1.2.3 (git 2.41.0)