Note about IDs
This commit is contained in:
pare
3585830182
commit
10eda366d5
S'han modificat 1 arxius amb 9 adicions i 7 eliminacions
|
@ -39,15 +39,22 @@ as a single python module. By default, it talks to the
|
||||||
`Mastodon flagship instance`_, but it can be set to talk to any
|
`Mastodon flagship instance`_, but it can be set to talk to any
|
||||||
node running Mastodon.
|
node running Mastodon.
|
||||||
|
|
||||||
|
A note about IDs
|
||||||
|
----------------
|
||||||
|
Mastodons API uses IDs in several places: User IDs, Toot IDs, ...
|
||||||
|
|
||||||
|
While debugging, it might be tempting to copy-paste in IDs from the
|
||||||
|
web interface into your code. This will not work, as the IDs on the web
|
||||||
|
interface and in the URLs are not the same as the IDs used internally
|
||||||
|
in the API, so don't do that.
|
||||||
|
|
||||||
Return values
|
Return values
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
Unless otherwise specified, all data is returned as python
|
Unless otherwise specified, all data is returned as python
|
||||||
dictionaries, matching the JSON format used by the API.
|
dictionaries, matching the JSON format used by the API.
|
||||||
|
|
||||||
User dicts
|
User dicts
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -90,7 +97,6 @@ Toot dicts
|
||||||
|
|
||||||
Relationship dicts
|
Relationship dicts
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
mastodon.account_follow(<numerical id>)
|
mastodon.account_follow(<numerical id>)
|
||||||
|
@ -104,7 +110,6 @@ Relationship dicts
|
||||||
|
|
||||||
Context dicts
|
Context dicts
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
mastodon.status_context(<numerical id>)
|
mastodon.status_context(<numerical id>)
|
||||||
|
@ -116,7 +121,6 @@ Context dicts
|
||||||
|
|
||||||
Media dicts
|
Media dicts
|
||||||
~~~~~~~~~~~
|
~~~~~~~~~~~
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
mastodon.media_post("image.jpg", "image/jpeg")
|
mastodon.media_post("image.jpg", "image/jpeg")
|
||||||
|
@ -128,8 +132,6 @@ Media dicts
|
||||||
'url': The URL for the media
|
'url': The URL for the media
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
App registration and user authentication
|
App registration and user authentication
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
Before you can use the mastodon API, you have to register your
|
Before you can use the mastodon API, you have to register your
|
||||||
|
|
Loading…
Referencia en una nova incidència