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