Preview API

There is 4 entity types you can preview without having to do an entity save and commit the changes to the database.

The 4 entity types are:

Articles
Visual Stories
Layouts
Events

in order to preview an entity you just build the REST formatted JSON (same as when updating an entity) ad post it to the respective endpoint.

All but the layout preview will return a preview ID that can be used to view the preview on the front end, eg

{"preview_id": "sucoaicuhasiuchoaiushocauhscoiushcoiauhcs"}

this would be available at https://independent.co.uk/preview/sucoaicuhasiuchoaiushocauhscoiushcoiauhcs

The Layout Preview returns the actual preview of the section page, having built it rom the layout changes.

Endpoints

// Article Preview
/api/preview/submit
    
// Visual Story Preview
/api/preview/story

// Event Preview
/api/preview/event

// Layout Preview
/api/preview/layout