api.markdown
66 lines
| 1.5 KiB
| text/x-markdown
|
MarkdownLexer
/ docs / api.markdown
neko259
|
r503 | # INTRO # | ||
The API is provided to query the data from a neaboard server by any client | ||||
application. | ||||
Tha data is returned in the json format and got by an http query. | ||||
# METHODS # | ||||
neko259
|
r524 | ## Threads ## | ||
neko259
|
r503 | /api/threads/N/?offset=M&tag=O | ||
neko259
|
r524 | Get a thread list. You will get ``N`` threads (required parameter) starting from | ||
``M``th one (optional parameter, default is 0) with the tag ``O`` (optional parameter, | ||||
neko259
|
r503 | threads with any tags are shown by default). | ||
neko259
|
r524 | ## Tags ## | ||
neko259
|
r503 | /api/tags/ | ||
Get all active tag list. Active tag is a tag that has at least 1 active thread | ||||
associated with it. | ||||
neko259
|
r524 | ## Thread ## | ||
neko259
|
r503 | /api/thread/N/ | ||
neko259
|
r524 | Get all ``N``th thread post. ``N`` is an opening post ID for the thread. | ||
neko259
|
r525 | Output format: | ||
* ``posts``: list of posts | ||||
* ``last_update``: last update timestamp | ||||
neko259
|
r524 | ## Thread diff ## | ||
/api/diff_thread/N/M/?type=O | ||||
Get the diff of the thread with id=``N`` from the ``M`` timestamp in the ``O`` | ||||
format. 2 formats are available: ``html`` (used in AJAX thread update) and | ||||
``json``. The default format is ``html``. Return list format: | ||||
* ``added``: list of added posts | ||||
* ``updated``: list of updated posts | ||||
* ``last_update``: last update timestamp | ||||
## General info ## | ||||
neko259
|
r503 | |||
In case of incorrect request you can get http error 404. | ||||
neko259
|
r523 | |||
neko259
|
r525 | Response JSON for a post or thread contains: | ||
neko259
|
r523 | |||
neko259
|
r524 | * ``id`` | ||
* ``title`` | ||||
* ``text`` | ||||
* ``image`` (if image available) | ||||
* ``image_preview`` (if image available) | ||||
neko259
|
r526 | * ``bump_time`` (for threads) | ||
neko259
|
r523 | |||
In future, it will also contain: | ||||
* tags list (for thread) | ||||
* publishing time | ||||
* bump time | ||||
* reply IDs (if available) | ||||