JSON Data

ContentBoot will publish JSON data with specified domain.

TIP

JSON data is just for small data size, please use GraphQL API Serve if your data size is big.

Access

In order to reduce the cache time and keep low traffic, we split the data to version JSON and data JSON. index.json with short cache time and data.{hash}.json with long cache time.

So we should fetch {protocol}://{domain}/index.json firstly. We will get similar JSON:

{
    "data": "{protocol}://{domain}/data.{hash}.json"
}

Then fetch {protocol}://{domain}/data.{hash}.json to get the JSON data.

Schema

JSON data schema is the same as document groups and documents schema in project. Let's take the demo website in getting started as example.

The JSON data just like this:

{
    "homePage": {
        "getStartedUrl": "https://docs.contentboot.com/guide/getting-started.html",
        "featuredProjects": [
            "d_7z0pu0kgr8",
            "d_j4pgpjn46b",
            "d_fwxnjl389u"
        ]
    },
    "projects": [
        {
            "id": "709",
            "title": "709",
            "publishDate": "2022-09-07T06:07:15.000Z",
            "tag": "Website",
            "images": [
                {
                    "path": "http://demo-assets.contentboot.com/web-project-2.646cb829986462bdd092a0da3d33e841.jpg"
                },
                ... // other images
            ],
            "clientName": "709",
            "objective": "Make a auth.",
            "technologies": [
                "Css",
                "Html"
            ],
            "detail": "<p>Make a auth.<br></p>"
        },
        ... // other projects
    ],
    "aboutPage": {
        "introduction": "A demo project using ContentBoot as CMS.\nDemo url: http://demo.contentboot.com"
    }
}
Last Updated: