[
https://issues.apache.org/jira/browse/SLING-9941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17240772#comment-17240772
]
Dan Klco commented on SLING-9941:
---------------------------------
Natively, Sling exposes all resources via JSON using the .json extension:
https://www.danklco.com/posts/2020/11/case-insensitive-queries-aem-query-builder.json
you can also retrieve multiple levels using numeric or the infinity selector,
e.g. /mypage.infinity.json (note I've blocked this on my personal site)
If you want more control over the exported values you can use the Sling Models
exporter:
https://sling.apache.org/documentation/bundles/models.html#exporter-framework-since-130-1
https://blogs.perficient.com/2018/07/26/no-servlets-required-exporting-data-with-sling-models/
Finally, it's not bundled in Sling CMS, but you can install the Sling GraphQL
Core bundle to query and load content via GraphQL:
https://sling.apache.org/documentation/bundles/graphql-core.html
Please re-open if you have any further questions.
> Accessing sling CMS resources in external application through API
> -----------------------------------------------------------------
>
> Key: SLING-9941
> URL: https://issues.apache.org/jira/browse/SLING-9941
> Project: Sling
> Issue Type: Improvement
> Reporter: Preetham Ponnappa
> Priority: Major
>
> I have a simple web app built with Sling CMS, having some react components. I
> want to know how Sling Contents can be retrieved using Sling API . Looking
> for some sample implementations
--
This message was sent by Atlassian Jira
(v8.3.4#803005)