diff options
author | Lorenz Diener <[email protected]> | 2016-11-25 20:34:45 +0100 |
---|---|---|
committer | Lorenz Diener <[email protected]> | 2016-11-25 20:34:45 +0100 |
commit | 10eda366d56ff9ea97e8509af935ddadcc5d176d (patch) | |
tree | cd2436b66eabdf7798334a943bc25020056c179d | |
parent | 3585830182215428b689738a7923121655390ae6 (diff) | |
download | mastodon.py-10eda366d56ff9ea97e8509af935ddadcc5d176d.tar.gz |
Note about IDs
-rw-r--r-- | docs/index.rst | 16 |
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 |
40 | node running Mastodon. | 40 | node running Mastodon. |
41 | 41 | ||
42 | A note about IDs | ||
43 | ---------------- | ||
44 | Mastodons API uses IDs in several places: User IDs, Toot IDs, ... | ||
45 | |||
46 | While debugging, it might be tempting to copy-paste in IDs from the | ||
47 | web interface into your code. This will not work, as the IDs on the web | ||
48 | interface and in the URLs are not the same as the IDs used internally | ||
49 | in the API, so don't do that. | ||
50 | |||
42 | Return values | 51 | Return values |
43 | ------------- | 52 | ------------- |
44 | |||
45 | Unless otherwise specified, all data is returned as python | 53 | Unless otherwise specified, all data is returned as python |
46 | dictionaries, matching the JSON format used by the API. | 54 | dictionaries, matching the JSON format used by the API. |
47 | 55 | ||
48 | User dicts | 56 | User dicts |
49 | ~~~~~~~~~~ | 57 | ~~~~~~~~~~ |
50 | |||
51 | .. code-block:: python | 58 | .. code-block:: python |
52 | 59 | ||
53 | { | 60 | { |
@@ -90,7 +97,6 @@ Toot dicts | |||
90 | 97 | ||
91 | Relationship dicts | 98 | Relationship 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 | ||
105 | Context dicts | 111 | Context 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 | ||
117 | Media dicts | 122 | Media 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 | |||
133 | App registration and user authentication | 135 | App registration and user authentication |
134 | ---------------------------------------- | 136 | ---------------------------------------- |
135 | Before you can use the mastodon API, you have to register your | 137 | Before you can use the mastodon API, you have to register your |