fix Google Login button at /login/
[mygpo.git] / api-docs / reference / subscriptions.rst
blob0bd51156535f0e4e13d70c032f3527a5604f2acc
1 .. _subscriptions-api:
3 Subscriptions API
4 =================
6 The subscriptions API is used to manage the podcast subscriptions of a client
7 device.
10 Resources
11 ---------
13 The Subscriptions API defines the following resources ::
15  /<username>/subscriptions
16  /<username>/device/<device-id>/subscriptions
19 Subscription Upload
20 -------------------
22 Upload the subscriptions for a device ::
24  PUT /<username>/device/<device-id>/subscriptions
25  Content-Tpe: application/json
27  TODO: specify body
30 The server can respond with the following status codes.
32 When a new device has been created ::
34  201 Created
35  Link: <https://api.gpodder.net/<username>/device/<device-id>/subscription?since=0>; rel=changes
36  ...
39 When the subscriptions have been processed immediatelly ::
41  204 No Content
42  Link: <https://api.gpodder.net/<username>/device/<device-id>/subscription?since=1234>; rel=changes
43  ...
46 When the subscriptions have been accepted for later processing ::
48  202 Accepted
49  Link: <https://api.gpodder.net/<username>/device/<device-id>/subscription?since=1234>; rel=changes
50  ...
51  TODO: return change download address here?
54 Any status code >= 200 and < 300 should be considered a success.
56 TODO: specify body?
59 Subscription Download
60 ---------------------
62 Download subscriptions of a device ::
64  GET /<username>/device/<device-id>/subscriptions
65  Content-Type: application/json
67  200 Found
68  Link: <https://api.gpodder.net/<username>/device/<device-id>/subscription?since=1234>; rel=changes
69  Content-Type: application/json
70  Last-Modified: ...
72  {
73      "add": [{ "url": "..."}, { ...}]
74      "timestamp": 1234,
75  }
78 Download all of the users subscriptions ::
80  GET /<username>/subscriptions
81  Content-Type: application/json
83  200 Found
84  Link: <https://api.gpodder.net/<username>/device/<device-id>/subscription?since=1234>; rel=changes
85  Content-Type: application/json
86  Last-Modified: ...
88  TODO: specify body
91 Subscription Change Upload
92 --------------------------
94 Upload changes to the subscriptions of a device ::
96  POST /<username>/device/<device-id>/subscriptions
97  Content-Tpe: application/json
99  TODO: specify body...
103 Subscription Change Download
104 ----------------------------
106 Download changes to the subscriptions of a device ::
108  GET /<username>/device/<device-id>/subscriptions?since=<since>
109  Content-Tpe: application/json
111  200 Found
112  Link: <https://api.gpodder.net/<username>/device/<device-id>/subscription?since=1234>; rel=changes
113  Content-Type: application/json
114  Last-Modified: ...
116  TODO: specify body...