Show More
@@ -1,75 +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 | ||||
|
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 | 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 | |
42 | ``json``. The default format is ``html``. Return list format: |
|
48 | ``json``. The default format is ``html``. Return list format: | |
43 |
|
49 | |||
44 | * ``added``: list of added posts |
|
50 | * ``added``: list of added posts | |
45 | * ``updated``: list of updated posts |
|
51 | * ``updated``: list of updated posts | |
46 | * ``last_update``: last update timestamp |
|
52 | * ``last_update``: last update timestamp | |
47 |
|
53 | |||
48 | ## Notifications ## |
|
54 | ## Notifications ## | |
49 |
|
55 | |||
50 | /api/notifications/<username>/[?last=<id>] |
|
56 | /api/notifications/<username>/[?last=<id>] | |
51 |
|
57 | |||
52 | Get user notifications for user starting from the post ID. |
|
58 | Get user notifications for user starting from the post ID. | |
53 |
|
59 | |||
54 | * ``username``: name of the notified user |
|
60 | * ``username``: name of the notified user | |
55 | * ``id``: ID of a last notification post |
|
61 | * ``id``: ID of a last notification post | |
56 |
|
62 | |||
57 | ## General info ## |
|
63 | ## General info ## | |
58 |
|
64 | |||
59 | In case of incorrect request you can get http error 404. |
|
65 | In case of incorrect request you can get http error 404. | |
60 |
|
66 | |||
61 | Response JSON for a post or thread contains: |
|
67 | Response JSON for a post or thread contains: | |
62 |
|
68 | |||
63 | * ``id`` |
|
69 | * ``id`` | |
64 | * ``title`` |
|
70 | * ``title`` | |
65 | * ``text`` |
|
71 | * ``text`` | |
66 | * ``image`` (if image available) |
|
72 | * ``image`` (if image available) | |
67 | * ``image_preview`` (if image available) |
|
73 | * ``image_preview`` (if image available) | |
68 | * ``bump_time`` (for threads) |
|
74 | * ``bump_time`` (for threads) | |
69 |
|
75 | |||
70 | In future, it will also contain: |
|
76 | In future, it will also contain: | |
71 |
|
77 | |||
72 | * tags list (for thread) |
|
78 | * tags list (for thread) | |
73 | * publishing time |
|
79 | * publishing time | |
74 | * bump time |
|
80 | * bump time | |
75 | * reply IDs (if available) |
|
81 | * reply IDs (if available) |
General Comments 0
You need to be logged in to leave comments.
Login now