It's an anonymous immutable feed aggregator.
{
"id": 0,
"author": "someone",
"title": "something",
"content": "text",
"createdDate": 766800000,
"lang": "en",
"tags": [
"life",
"death"
]
}
id
is long value.createdDate
is Unix timestamp in milliseconds.lang
is 2-letter language code defined in ISO 639.- Fields
author
,theme
andlang
can benull
.
{
"page": 0,
"posts": [
{
"id": 0,
"author": "someone",
"title": "something",
"content": "text",
"createdDate": 766800000,
"lang": "en",
"tags": [
"life",
"death"
]
}
],
"hasNextPage": false
}
As you can see posts
is just array of Post schema, but content
could be trim.
Also posts
can be empty.
GET /api/{page}
Parameters:
page
(optional, integer, default 0) - page value
Response: Page schema.
GET /api/post/{id}
Parameters:
id
(required, long) - ID of a post
Response: Post schema or code 404.
POST /api/post
Parameters:
title
(required, string, max length 64 chars) - title of this postcontent
(required, string) - content of this postauthor
(optional, string, max length 64 chars) - author of this posttags
(optional, array of strings) - tags for this postlang
(optional, string) - 2-letter language code
As you can see it's the same Post schema, but without fields id
and createdDate
.
Example request:
{
"title": "How we do some cool stuff",
"author": "Some cool guy",
"content": "We just do it!",
"lang": "en",
"tags": [
"life",
"death"
]
}
Response: code 201 and header "Location".
GET /api/author/{author}/{page}
Parameters:
author
(required, string) - author that you want to searchpage
(optional, integer, default 0) - page value
Response: Page schema.
GET /api/tag/{tag}/{page}
Parameters:
tag
(required, string) - tag that you want to searchpage
(optional, integer, default 0) - page value
Response: Page schema.