API & Embed Documentation
All API endpoints require a Bearer token:
Authorization: Bearer <token> (configured in config.php).
Endpoints
Base path: /lifejournal
/lifejournal/api/plan.php?slug=life-journal-classic&year=2025&mode=day&n=7- Readings for a specific day number (1–365/366). Param:
n. /lifejournal/api/plan.php?slug=life-journal-classic&year=2025&mode=date&date=2025-01-07- Readings for a specific calendar date (YYYY-MM-DD, in America/Chicago).
/lifejournal/api/plan.php?slug=life-journal-classic&year=2025&mode=next7&from=2025-01-07- Next 7 days starting from the given date (default: today).
/lifejournal/api/plan.php?slug=life-journal-classic&year=2025&mode=week&for=2025-01-07- Sun–Sat week containing the given date (default: today). Matches “previous Sunday unless today is Sunday.”
/lifejournal/api/plan.php?slug=life-journal-classic&year=2025&mode=month&mm=01- All readings for the calendar month (MM = 01–12).
Typical response shape
All responses contain a plan object and a scope. Depending on the mode, you’ll get either a flat readings array or a days map keyed by date.
{
"plan": { "slug": "life-journal-classic", "title": "Life Journal Reading Plan" },
"scope": { "year": 2025, "mode": "date", "date": "2025-01-07", "day_number": 7 },
"readings": [
{ "book": "Genesis", "book_short": "Gen", "range": "18-19" },
{ "book": "Psalms", "book_short": "Ps", "range": "3" },
{ "book": "Luke", "book_short": "Lk", "range": "7" }
]
}
Authentication
Send your token in the Authorization header. Examples:
# cURL
curl -H "Authorization: Bearer YOUR_TOKEN" \
"https://go.andydelgado.com/lifejournal/api/plan.php?slug=life-journal-classic&year=2025&mode=date&date=2025-10-10"
# PHP
$ch = curl_init("https://go.andydelgado.com/lifejournal/api/plan.php?slug=life-journal-classic&year=2025&mode=week&for=2025-10-10");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_TOKEN','Accept: application/json']
]);
$json = curl_exec($ch);
$data = json_decode($json, true);
CORS Note: The API is intended for server-to-server calls (token stays private). Do not call it directly from browsers on other domains. Use the embed widget or proxy it through your server.
Embeddable Week Widget
Render a Sun–Sat week with “Read All” (NKJV on BibleGateway) and per-reading links. The embed fetches data server-side on go.andydelgado.com so your token is never exposed.
Quick use
<div id="lj-week-widget"></div>
<script src="https://go.andydelgado.com/lifejournal/embed/week.php?container=%23lj-week-widget"></script>
Optional parameters
for: YYYY-MM-DD (default: today in America/Chicago).theme:light(default) ordark.container: CSS selector to inject into (e.g.,%23my-div).
Example:
<script src="https://go.andydelgado.com/lifejournal/embed/week.php?for=2025-10-10&theme=light"></script>
Registration: If you plan to embed on your site, request access at
/lifejournal/register.php.
We’ll approve domains and (optionally) issue public keys and track displays.
Errors & Status
- 401/403 – missing/invalid token.
- 400 – invalid parameters (bad date/month).
- 500 – server error (check logs).
Security Notes
- Add
.htaccessrules to deny direct access to sensitive files (we recommend it even though PHP won’t render them as plain text). - Call the API from your server only; use the embed for cross-domain display.