DocumentationAEM as a Cloud ServiceUser Guide

JSON Exporter for Content Services

Last update: February 7, 2025
  • Applies to:
  • Experience Manager as a Cloud Service
  • Topics:
  • Developing

CREATED FOR:

  • Admin
  • Developer

AEM Content Services are designed to generalize the description and delivery of content in/from AEM beyond the focus of web pages.

They provide the delivery of content to channels that are not traditional AEM web pages, using standardized methods that can be consumed by any client. These channels can include:

  • Single Page Applications
  • Native Mobile Applications
  • Other channels and touch-points external to AEM

With content fragments that use structured content, you can provide content services by using the JSON exporter to deliver the contents of an(y) AEM page in JSON data model format. This can then be consumed by your own applications.

JSON Exporter with Content Fragment Core Components

Using the AEM JSON exporter you can deliver the contents of an(y) AEM page in JSON data model format. This can then be consumed by your own applications.

Within AEM the delivery is achieved using the selector model and .json extension.

.model.json

  1. For example, a URL such as:

    http://localhost:4502/content/wknd/language-masters/en/magazine/guide-la-skateparks.model.json
    
  2. Will deliver content such as:

    JSON model of WKND content

You can alternatively deliver the contents of a structured content fragment by targeting it specifically.

This is done using the entire path to the fragment (via the jcr:content); for example, with a suffix such as.

.../jcr:content/root/container/container/contentfragment.model.json

Your page can contain either a single content fragment or multiple components of various types. You can also use mechanisms such as list components to automatically search for relevant content.

  • For example, a URL such as:

    http://localhost:4502/content/wknd/language-masters/en/magazine/guide-la-skateparks/jcr:content/root/container/container/contentfragment.model.json
    
  • Will deliver content such as:

    JSON model of WKND content fragment

    NOTE
    You can adapt your own components to access and use this data.
    NOTE
    Although not a standard implementation, multiple selectors are supported, but model must be the first.

Further Information

  • Assets HTTP API
    • Assets HTTP API
  • Sling Models:
    • Sling Models - Associating a model class with a resource type since 130
  • AEM with JSON:
    • Enabling JSON Export for a Component

Related Documentation

  • Content Fragments
  • Content Fragment Models
  • Authoring with Content Fragments
  • Core Components and the Content Fragment component
recommendation-more-help
fbcff2a9-b6fe-4574-b04a-21e75df764ab