Quickstart

Quickstart: Keep regulated copy in sync with the CMS

Regulated copy must match the source exactly; fetch it by key and refresh when updated_at changes rather than pasting and forgetting. This recipe shows the exact code, uses only the unauthenticated public ring, and links out to the endpoints and the application flow so the reader always has a next step.

2 min read

by keyStable content id
updated_atRefresh trigger
no driftOne source of truth

Fetch and cache by key

def get_copy(key):
    cached = cache.get(f'cms:{key}')
    resp = requests.get(f'{BASE}/cms/pages/{key}', timeout=10).json()
    if not cached or cached['updated_at'] != resp['updated_at']:
        cache.set(f'cms:{key}', resp)
    return resp['body']

Why this matters for compliance

A representative example or risk warning that drifts out of date is a compliance problem. Pulling it by key means a change we make propagates to your page automatically, with an audit trail via updated_at.

Frequently asked questions

Which keys can I fetch?

The keys documented in the reference for public content items. An unknown key returns a 404.

How do I know when copy changed?

Compare the updated_at you have cached with the latest response. If it changed, the copy changed — refresh your cache.

Funding for UK limited companies

Credicorp lends to your company, not to you personally — short-term working capital with no personal guarantee. See what your business could access.