Skip to content

Commit fa3f23f

Browse files
committed
[Docs] move API docs from wiki to Sphinx
1 parent 4482f19 commit fa3f23f

26 files changed

+1214
-1390
lines changed

doc/_ext/jsonlexer.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
def setup(app):
2+
# enable Pygments json lexer
3+
try:
4+
import pygments
5+
if pygments.__version__ >= '1.5':
6+
# use JSON lexer included in recent versions of Pygments
7+
from pygments.lexers import JsonLexer
8+
else:
9+
# use JSON lexer from pygments-json if installed
10+
from pygson.json_lexer import JSONLexer as JsonLexer
11+
except ImportError:
12+
pass # not fatal if we have old (or no) Pygments and no pygments-json
13+
else:
14+
app.add_lexer('json', JsonLexer())

doc/api/changes.rst

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
API Changes
2+
===========
3+
4+
This page lists changes to the Advanced API. The current version is 2.11. This versioning scheme has been introduced in [1].
5+
6+
Version 2.11
7+
------------
8+
9+
added Download All subscriptions
10+
11+
Version 2.10
12+
------------
13+
14+
added Authentication API [2]
15+
added Device Synchronization API [3]
16+
added Podcast Lists API [4]
17+
added include_actions parameter to Device Update API [5]
18+
19+
20+
Version 2.9
21+
-----------
22+
23+
added XML format to some Simple API requests [6] [7]
24+
25+
26+
Version 2.8
27+
-----------
28+
29+
added JSONP as a format to Simple API requests [8]
30+
31+
32+
Version 2.7
33+
-----------
34+
35+
added API Parametrization
36+
37+
38+
Version 2.6
39+
-----------
40+
41+
added "released" to Retrieving Episode Data and Listing Favorite Episodes
42+
43+
44+
Version 2.5
45+
-----------
46+
added "Subscribers Last Week" to Retrieving Podcast Data [9]
47+
48+
49+
Version 2.4
50+
-----------
51+
52+
added Saving a Setting [10]
53+
added Retrieving Settings
54+
added Listing Favorite Episodes
55+
56+
57+
Version 2.3
58+
-----------
59+
60+
added Retrieving Updates for a Device
61+
62+
63+
Version 2.2
64+
-----------
65+
66+
added Retrieving Top Tags
67+
added Retrieving Podcasts of a Tag
68+
added Retrieving Podcast Data
69+
added Retrieving Episode Data
70+
71+
72+
Version 2.1
73+
-----------
74+
75+
added aggregated=true to Retrieving episode actions [11]
76+
77+
78+
Version 2.0
79+
-----------
80+
81+
added Add/remove subscriptions
82+
added Retrieving subscription changes
83+
added Uploading episode actions
84+
added Retrieving episode actions
85+
added (Re)naming devices and setting the type
86+
added Getting a list of devices
87+

doc/api/deprecation.rst

Lines changed: 0 additions & 16 deletions
This file was deleted.

doc/api/index.rst

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,35 @@
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.
55
6-
API 3 Documentation (draft)
7-
===========================
6+
API Documentation
7+
=================
88

9-
*This site contains drafts for the gpodder.net's future API -- version 3 --
10-
which is not yet implemented. The current API is documented at
11-
http://wiki.gpodder.org/wiki/Web_Services/API_2.*
9+
This is the specification of Version 2 of the public API for the gpodder.net
10+
Web Services.
1211

13-
The gpodder.net API allows clients to interact with gpodder.net. The API is
14-
provided via a REST interface, and is free of charge within certain quotas, and
15-
completely free for open source clients (see :ref:`usage`).
12+
Please consult the :doc:`integration` before integrating the gpodder.net API
13+
in your application.
14+
15+
There are two different APIs for different target audiences:
16+
17+
* The **Simple API** targets developers who want to write quick integration
18+
into their existing applications
19+
* The **Advanced API** targets developers who want tight integration into their
20+
applications (with more features)
21+
22+
The API is versioned so that changes in the major version number indicate
23+
backwards incompatible changes. All other changes preserve backwards
24+
compatibility. See :doc:`changes` for a list of changes. The current
25+
version is 2.11. This versioning scheme has been introduced in `bug 1273
26+
<https://bugs.gpodder.org/show_bug.cgi?id=1273>`_.
1627

1728
Contents
1829
--------
1930

2031
.. toctree::
2132
:maxdepth: 2
2233

23-
usage
2434
integration
2535
reference/index
26-
deprecation
27-
libraries
36+
Libraries <http://wiki.gpodder.org/wiki/Web_Services/Libraries>
37+
changes

doc/api/integration.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,16 @@ device Id like the following
6868
* a web based player (*mywebservice-myusername*)
6969

7070
When a previously unknown device Id is used in some API request, a device is
71-
automatically created. Refer to the :ref:`devices-api` on how to provide some
72-
information about the device. Users can manage their devices `online
71+
automatically created. Refer to the :doc:`reference/devices` on how to provide
72+
some information about the device. Users can manage their devices `online
7373
<https://gpodder.net/devices>`_.
7474

7575

7676
Podcast Directory
7777
^^^^^^^^^^^^^^^^^
7878

7979
The most basic *passive* integration with gpodder.net is to access some of its
80-
public data. Refer to the :ref:`directory-api` for available endpoints.
80+
public data. Refer to the :doc:`reference/directory` for available endpoints.
8181

8282

8383
Subscription Management
@@ -86,7 +86,7 @@ Subscription Management
8686
The most common form of *active* integration is subscription management.
8787
Clients can upload the podcast subscriptions using their device Id and receive
8888
subscription changes (for their device) that were made online. Refer to the
89-
:ref:`subscriptions-api` for additional information.
89+
:doc:`reference/subscriptions` for additional information.
9090

9191

9292
Episode Actions Synchronization
@@ -95,5 +95,5 @@ Episode Actions Synchronization
9595
Clients can upload and download certain actions (episode downloaded, played,
9696
deleted) to/from gpodder.net. This gives the user a central overview of
9797
where and when he accessed certain podcast episodes, and allows clients to
98-
synchronise states between applications. Refer to the :ref:`events-api` for
99-
further information.
98+
synchronise states between applications. Refer to the :doc:`reference/events`
99+
for further information.

doc/api/libraries.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.

doc/api/reference/auth.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,36 @@
11
Authentication API
22
==================
3+
4+
Login / Verify Login
5+
--------------------
6+
7+
.. http:post:: /api/2/auth/(username)/login.json
8+
:synopsis: verify the login status
9+
10+
* since 2.10
11+
12+
Log in the given user for the given device via HTTP Basic Auth.
13+
14+
:param username: the username which should be logged in
15+
:status 401: If the URL is accessed without login credentials provided
16+
:status 400: If the client provides a cookie, but for a different username than the one given
17+
:status 200: the response headers have a ``sessionid`` cookie set.
18+
19+
The client can use this URL with the cookie in the request header to check
20+
if the cookie is still valid.
21+
22+
23+
Logout
24+
------
25+
26+
.. http:post:: /api/2/auth/(username)/logout.json
27+
:synopsis: logout
28+
29+
* since 2.10
30+
31+
Log out the given user. Removes the session ID from the database.
32+
33+
:param username: the username which should be logged out
34+
:status 200: if the client didn't send a cookie, or the user was
35+
successfully logged out
36+
:status 400: if the client provides a cookie, but for a different username than the one given

doc/api/reference/clientconfig.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Client Parametrization
2+
======================
3+
4+
The client configuration file is located at
5+
http://gpodder.net/clientconfig.json and contains information that clients
6+
should retrieve before making requests to the APIs.
7+
8+
If a client cannot retrieve and process this file (either temporarily or
9+
permanently), it can assume the default values provided below. However,
10+
the URLs in the file might reflect changed URLs and/or mirror servers. If a
11+
client decides to permanently ignore this file, it might hit an outdated URL
12+
or an overloaded server.
13+
14+
15+
Commented Example
16+
-----------------
17+
18+
.. code-block:: json
19+
20+
{
21+
"mygpo": {
22+
"baseurl": "http://gpodder.net/"
23+
}
24+
25+
"mygpo-feedservice": {
26+
"baseurl": "http://mygpo-feedservice.appspot.com/"
27+
}
28+
29+
"update_timeout": 604800,
30+
}
31+
32+
* ``mygpo/baseurl``: URL to which the gpodder.net API Endpoints should be appended
33+
* ``mygpo-feedservice/baseurl``: Base URL of the gpodder.net feed service
34+
* ``update_timeout``: Time in seconds for which the values in this file can be considered valid.

0 commit comments

Comments
 (0)