What is your developer-dependent CMS actually costing you? Calculate your costs and get a full report
What is your developer-dependent CMS actually costing you? Calculate your costs and get a full report
Content Architecture
Use Agility content outside the website: how mobile apps, kiosks, email and in-app surfaces read content with the Fetch API, GraphQL and Content Sync, and how to model content that works in every channel.
Agility content isn't tied to a website. Everything you store is available as JSON through Agility's APIs, so the same content can feed a mobile app, a kiosk or digital sign, an email, or messages inside a product. This page covers how to read content for each kind of channel, and how to model content so it works in all of them.
A website built with Agility usually uses pages, the sitemap and Components. Other channels usually skip those and read content lists and items directly. You have three ways to read them:
| Content Fetch API (REST) | GraphQL API | Content Sync | |
|---|---|---|---|
| What you get | One item, list, page or sitemap per request | Exactly the fields you select, several queries per request | Every item and page that changed since your last sync, copied into your own store |
| Where the channel reads from | Agility, on each request | Agility, on each request | Your own store (files, database, cache) |
| Good for | Apps and services that fetch on demand | Screens that need fields from several lists in one round trip | Offline devices, high read volume, feeding other systems |
All three read either published content (with a fetch key) or the latest saved content (with a preview key), so you can build a preview version of any channel. The details, and when to choose Sync, are in Content Sync Explained.
To react to changes instead of polling, use Webhooks: Agility calls your endpoint when content is published or saved, and your service refreshes its cache, re-syncs, or rebuilds what it needs.
For a complete architecture that combines these patterns across a website, app, email and kiosks, see Reference Architecture: Multi-Channel Delivery.
filter and take), rather than downloading a whole list.Content that works everywhere follows a few rules:
ShortTitle field with a maximum length, rather than truncating the web title in code.take? The Fetch API returns 10 items by default and GraphQL lists 50; the maximum is 250.