##// END OF EJS Templates
Updated API documentation
neko259 -
r1087:bd081f79 default
parent child Browse files
Show More
@@ -1,75 +1,81 b''
1 1 # INTRO #
2 2
3 3 The API is provided to query the data from a neaboard server by any client
4 4 application.
5 5
6 6 Tha data is returned in the json format and got by an http query.
7 7
8 8 # METHODS #
9 9
10 10 ## Threads ##
11 11
12 12 /api/threads/N/?offset=M&tag=O
13 13
14 14 Get a thread list. You will get ``N`` threads (required parameter) starting from
15 15 ``M``th one (optional parameter, default is 0) with the tag ``O`` (optional parameter,
16 16 threads with any tags are shown by default).
17 17
18 18 ## Tags ##
19 19
20 20 /api/tags/
21 21
22 22 Get all active tag list. Active tag is a tag that has at least 1 active thread
23 23 associated with it.
24 24
25 25 ## Thread ##
26 26
27 27 /api/thread/N/
28 28
29 29 Get all ``N``th thread post. ``N`` is an opening post ID for the thread.
30 30
31 31 Output format:
32 32
33 33 * ``posts``: list of posts
34 34 * ``last_update``: last update timestamp
35 35
36 36 ## Thread diff ##
37 37
38 /api/diff_thread/N/M/?type=O
38 /api/diff_thread
39
40 Parameters:
39 41
40 Get the diff of the thread with id=``N`` from the ``M`` timestamp in the ``O``
42 * ``thread``: thread id
43 * ``last_update``: last update timestamp
44 * ``last_post``: last added post id
45
46 Get the diff of the thread in the `O``
41 47 format. 2 formats are available: ``html`` (used in AJAX thread update) and
42 48 ``json``. The default format is ``html``. Return list format:
43 49
44 50 * ``added``: list of added posts
45 51 * ``updated``: list of updated posts
46 52 * ``last_update``: last update timestamp
47 53
48 54 ## Notifications ##
49 55
50 56 /api/notifications/<username>/[?last=<id>]
51 57
52 58 Get user notifications for user starting from the post ID.
53 59
54 60 * ``username``: name of the notified user
55 61 * ``id``: ID of a last notification post
56 62
57 63 ## General info ##
58 64
59 65 In case of incorrect request you can get http error 404.
60 66
61 67 Response JSON for a post or thread contains:
62 68
63 69 * ``id``
64 70 * ``title``
65 71 * ``text``
66 72 * ``image`` (if image available)
67 73 * ``image_preview`` (if image available)
68 74 * ``bump_time`` (for threads)
69 75
70 76 In future, it will also contain:
71 77
72 78 * tags list (for thread)
73 79 * publishing time
74 80 * bump time
75 81 * reply IDs (if available)
General Comments 0
You need to be logged in to leave comments. Login now