aboutsummaryrefslogtreecommitdiff
path: root/API.md
diff options
context:
space:
mode:
authorrr-2016-04-23 08:07:21 +0200
committerrr-2016-04-23 08:07:21 +0200
commit1476c84a9da107214ba61842ba7afe8e1e3ece28 (patch)
tree4e61b8567417704919b29af9f3621852be1f2f56 /API.md
parentcf00a3a2dea7f7d1e62184fa00c24deaa5b062b9 (diff)
server/posts: add featured post retrieval
Diffstat (limited to 'API.md')
-rw-r--r--API.md57
1 files changed, 56 insertions, 1 deletions
diff --git a/API.md b/API.md
index b301016..caa2e61 100644
--- a/API.md
+++ b/API.md
@@ -36,6 +36,7 @@
- ~~Scoring posts~~
- ~~Adding posts to favorites~~
- ~~Removing posts from favorites~~
+ - [Getting featured post](#getting-featured-post)
- [Featuring post](#featuring-post)
- Users
- [Listing users](#listing-users)
@@ -48,6 +49,8 @@
- [Password reset - step 2: confirmation](#password-reset---step-2-confirmation)
- Snapshots
- [Listing snapshots](#listing-snapshots)
+ - Global info
+ - [Getting global info](#getting-global-info)
3. [Resources](#resources)
@@ -601,6 +604,37 @@ data.
list is truncated to the first 50 elements. Doesn't use paging.
+## Getting featured post
+- **Request**
+
+ `GET /featured-post`
+
+- **Output**
+
+ ```json5
+ {
+ "post": <post>,
+ "snapshots": [
+ <snapshot>,
+ <snapshot>,
+ <snapshot>
+ ]
+ }
+ ```
+ ...where `<post>` is a [post resource](#post), and `snapshots` contain its
+ earlier versions.
+
+- **Errors**
+
+ - privileges are too low
+
+- **Description**
+
+ Retrieves the post that is currently featured on the main page in web
+ client. If no post is featured, `<post>` is null and `snapshots` array is
+ empty.
+
+
## Featuring post
- **Request**
@@ -628,7 +662,7 @@ data.
- **Description**
- Features a post on the main page.
+ Features a post on the main page in web client.
## Listing users
@@ -957,6 +991,27 @@ data.
None.
+## Getting global info
+- **Request**
+
+ `GET /info`
+
+- **Output**
+
+ ```json5
+ {
+ "postCount": <post-count>,
+ "diskUsage": <disk-usage>, // in bytes
+ "featuredPost": <featured-post>
+ }
+ ```
+
+- **Description**
+
+ Retrieves simple statistics. `<featured-post>` is null if there is no
+ featured post yet.
+
+
# Resources

© 2015 - 2026 Jakob L. Kreuze