Contact form
The smallest useful data host is a contact form: anyone may submit a message, only you may read the messages back. It is one collection, two endpoints and one user.
api.example.com/
datahoster-collections/
messages/ the table
datahoster-collection.json
datahoster-collection-columns/
name.json
email.json
message.json
handled.json
datahoster-endpoints/
submit/ anyone may POST a message
datahoster-endpoint-insert.json
inbox/ only you may read them back
datahoster-endpoint-select.json
datahoster-users/
you.json
The collection
messages is a collection of four
columns: name, email and message
hold the submission, and handled is a boolean you flip once you have dealt with it.
Every collection also carries automatic id, at and by columns.
The endpoints
Two endpoints sit in front of the collection. submit is an
open insert: it takes name, email and
message, adds a row, and anyone may call it. inbox is a private
select: it returns the rows, and only you may call it.
The user
you.json is a single user holding an access token. Listing
that user in the inbox endpoint's permission is what keeps the messages private while
submit stays open to the world.
Calling it
Point an HTML form at https://api.example.com/submit and every submission becomes a row
in messages. GET https://api.example.com/inbox, with your token, to read
them back.