mxHeadless
REST API gateway для headless-фронтендов на MODX 3. Ресурсы, объекты, OpenAPI, API keys и OAuth

Подставьте свой host вместо https://example.com.
curl -s https://example.com/api/v1 | jq
curl -s https://example.com/api/v1/health | jq
curl -s https://example.com/api/v1/schema | jqcurl -s 'https://example.com/api/v1/resources?limit=5&filter[published]=1&sort=-id&fields=id,pagetitle,uri' | jq
curl -s https://example.com/api/v1/resources/5 | jq
curl -s 'https://example.com/api/v1/pages/about?fields=id,pagetitle,content' | jqcurl -s 'https://example.com/api/v1/resources?filter[parent]=2&filter[published]=1' | jq
curl -s 'https://example.com/api/v1/resources?filter[pagetitle][like]=%News%' | jqexport MXHEADLESS_API_KEY='mxh_...'
curl -s https://example.com/api/v1/chunks \
-H "Authorization: Bearer $MXHEADLESS_API_KEY" | jqcurl -s -X POST https://example.com/api/v1/resources \
-H "Authorization: Bearer $MXHEADLESS_API_KEY" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: create-page-001' \
-d '{
"pagetitle": "API created page",
"parent": 2,
"template": 1,
"published": 0
}' | jqTOKEN=$(curl -s -X POST https://example.com/api/v1/auth/token \
-H 'Content-Type: application/json' \
-d '{"grant_type":"client_credentials","client_id":"...","client_secret":"...","scope":"resources.read"}' \
| jq -r .access_token)
curl -s https://example.com/api/v1/resources \
-H "Authorization: Bearer $TOKEN" | jqcurl -s 'https://example.com/assets/components/mxheadless/api.php?route=/v1/health' | jqФреймворки: Nuxt / Next / SvelteKit в репозитории.