This site is hosted on GitHub Pages, so it cannot run a server-side API by itself. Use the Supabase REST API as the API layer for Apple Shortcuts.
Request:
POST https://bmpklgjyqvxwkuvlnhmi.supabase.co/rest/v1/entries
Headers:
apikey: sb_publishable_gKyIEllCTpKJqtYJ7A6mng_8iMBxcwJ
Authorization: Bearer sb_publishable_gKyIEllCTpKJqtYJ7A6mng_8iMBxcwJ
Content-Type: application/json
Prefer: return=representation
JSON body:
{
"id": "PUT-A-UUID-HERE",
"parent_id": null,
"content_html": "Text from Apple Shortcuts",
"comments": [],
"author_id": "me",
"author_color": "blue"
}The database will fill created_at automatically.
Request:
GET https://bmpklgjyqvxwkuvlnhmi.supabase.co/rest/v1/entries?select=id,parent_id,content_html,created_at,comments,author_id,author_color&order=created_at.desc&limit=20
Use the same apikey and Authorization headers.
- Add
TextorAsk for Input. - Add
Generate UUID. - Add
Dictionarywith these keys:id: generated UUIDparent_id: empty valuecontent_html: input textcomments: empty listauthor_id:meorwifeauthor_color:blueorred
- Add
Get Contents of URL. - Set method to
POST. - Set request body to
JSON. - Add the headers listed above.
- Run the shortcut.
- Open the website and press
重拉to reload from Supabase.
Create two shortcuts, one for each person.
Shortcut A:
{
"author_id": "me",
"author_color": "blue"
}Shortcut B:
{
"author_id": "wife",
"author_color": "red"
}The website only uses author_color to color the entry border. It does not show
the user name or expose a user selector on the page.
This is convenient, but the current database policy allows public insert/update. For a private personal API, the next upgrade should be a Supabase Edge Function with a secret token, so only your shortcuts can write entries.