API: Content
Public read routes: the roll, the standard, posts, galleries and people.
Every HTML route returns JSON with Accept: application/json. Authentication: session cookie, X-API-KEY, Authorization: Bearer or Basic.
GET
Home
/guestLatest posts and the featured flyer.
curl -X GET -H 'Accept: application/json' 'http://staging.app.molodetz.nl/'
const response = await fetch("/", { method: "GET", headers: { "Accept": "application/json" } });
console.log(await response.json());
import httpx
print(httpx.request("GET", BASE + "/", headers={"Accept": "application/json", "X-API-KEY": API_KEY}).json())
{
"flyer_count": 4,
"meme_count": 22,
"posts": []
}
Not sent yet.
GET
The roll
/rollguestPublished notes in the roll topic, newest first, cursor paginated.
| Field | Type | Location | Required |
|---|---|---|---|
before | string | query | no |
curl -X GET -H 'Accept: application/json' 'http://staging.app.molodetz.nl/roll'
const response = await fetch("/roll", { method: "GET", headers: { "Accept": "application/json" } });
console.log(await response.json());
import httpx
print(httpx.request("GET", BASE + "/roll", headers={"Accept": "application/json", "X-API-KEY": API_KEY}).json())
{
"next_cursor": null,
"posts": [],
"title": "Roll",
"topic": "roll"
}
Not sent yet.
GET
The standard
/standardguestPublished posts in the standard topic.
curl -X GET -H 'Accept: application/json' 'http://staging.app.molodetz.nl/standard'
const response = await fetch("/standard", { method: "GET", headers: { "Accept": "application/json" } });
console.log(await response.json());
import httpx
print(httpx.request("GET", BASE + "/standard", headers={"Accept": "application/json", "X-API-KEY": API_KEY}).json())
{
"posts": [],
"title": "Standard",
"topic": "standard"
}
Not sent yet.
GET
Post
/posts/{slug}guestA published post by slug or uid. Old slugs redirect with 301 to the canonical slug.
| Field | Type | Location | Required |
|---|---|---|---|
slug | string | path | yes |
curl -X GET -H 'Accept: application/json' 'http://staging.app.molodetz.nl/posts/a-pass-is-not-an-ambition'
const response = await fetch("/posts/{slug}", { method: "GET", headers: { "Accept": "application/json" } });
console.log(await response.json());
import httpx
print(httpx.request("GET", BASE + "/posts/{slug}", headers={"Accept": "application/json", "X-API-KEY": API_KEY}).json())
{
"author": {
"username": "retoor"
},
"post": {
"title": "A pass is not an ambition.",
"topic": "roll"
}
}
Not sent yet.
GET
Flyers
/flyersguestFlyer gallery.
curl -X GET -H 'Accept: application/json' 'http://staging.app.molodetz.nl/flyers'
const response = await fetch("/flyers", { method: "GET", headers: { "Accept": "application/json" } });
console.log(await response.json());
import httpx
print(httpx.request("GET", BASE + "/flyers", headers={"Accept": "application/json", "X-API-KEY": API_KEY}).json())
{
"items": [],
"kind": "flyer",
"title": "Flyers"
}
Not sent yet.
GET
Memes
/memesguestMeme gallery.
curl -X GET -H 'Accept: application/json' 'http://staging.app.molodetz.nl/memes'
const response = await fetch("/memes", { method: "GET", headers: { "Accept": "application/json" } });
console.log(await response.json());
import httpx
print(httpx.request("GET", BASE + "/memes", headers={"Accept": "application/json", "X-API-KEY": API_KEY}).json())
{
"items": [],
"kind": "meme",
"title": "Memes"
}
Not sent yet.
GET
People
/peopleguestPeople on the roll.
curl -X GET -H 'Accept: application/json' 'http://staging.app.molodetz.nl/people'
const response = await fetch("/people", { method: "GET", headers: { "Accept": "application/json" } });
console.log(await response.json());
import httpx
print(httpx.request("GET", BASE + "/people", headers={"Accept": "application/json", "X-API-KEY": API_KEY}).json())
{
"people": [
{
"post_count": 5,
"username": "retoor"
}
]
}
Not sent yet.
GET
Person
/people/{username}guestProfile with posts.
| Field | Type | Location | Required |
|---|---|---|---|
username | string | path | yes |
curl -X GET -H 'Accept: application/json' 'http://staging.app.molodetz.nl/people/retoor'
const response = await fetch("/people/{username}", { method: "GET", headers: { "Accept": "application/json" } });
console.log(await response.json());
import httpx
print(httpx.request("GET", BASE + "/people/{username}", headers={"Accept": "application/json", "X-API-KEY": API_KEY}).json())
{
"person": {
"username": "retoor"
},
"posts": []
}
Not sent yet.
GET
robots.txt
/robots.txtguestcurl -X GET -H 'Accept: application/json' 'http://staging.app.molodetz.nl/robots.txt'
const response = await fetch("/robots.txt", { method: "GET", headers: { "Accept": "application/json" } });
console.log(await response.json());
import httpx
print(httpx.request("GET", BASE + "/robots.txt", headers={"Accept": "application/json", "X-API-KEY": API_KEY}).json())
No example
GET
Sitemap
/sitemap.xmlguestcurl -X GET -H 'Accept: application/json' 'http://staging.app.molodetz.nl/sitemap.xml'
const response = await fetch("/sitemap.xml", { method: "GET", headers: { "Accept": "application/json" } });
console.log(await response.json());
import httpx
print(httpx.request("GET", BASE + "/sitemap.xml", headers={"Accept": "application/json", "X-API-KEY": API_KEY}).json())
No example
GET
Avatar
/avatar/svg/{seed}guestDeterministic SVG avatar.
curl -X GET -H 'Accept: application/json' 'http://staging.app.molodetz.nl/avatar/svg/{seed}'
const response = await fetch("/avatar/svg/{seed}", { method: "GET", headers: { "Accept": "application/json" } });
console.log(await response.json());
import httpx
print(httpx.request("GET", BASE + "/avatar/svg/{seed}", headers={"Accept": "application/json", "X-API-KEY": API_KEY}).json())
No example
GET
Health
/healthguestLiveness and version.
curl -X GET -H 'Accept: application/json' 'http://staging.app.molodetz.nl/health'
const response = await fetch("/health", { method: "GET", headers: { "Accept": "application/json" } });
console.log(await response.json());
import httpx
print(httpx.request("GET", BASE + "/health", headers={"Accept": "application/json", "X-API-KEY": API_KEY}).json())
{
"status": "ok",
"version": "1.0.0"
}
Not sent yet.
GET
Presence
/presence/rosterguestOnline set (uids).
curl -X GET -H 'Accept: application/json' 'http://staging.app.molodetz.nl/presence/roster'
const response = await fetch("/presence/roster", { method: "GET", headers: { "Accept": "application/json" } });
console.log(await response.json());
import httpx
print(httpx.request("GET", BASE + "/presence/roster", headers={"Accept": "application/json", "X-API-KEY": API_KEY}).json())
{
"online": [],
"tracked": 0
}
Not sent yet.