Create new Viewports
Scroll Viewport provides a REST API for creating new viewports. To create a viewport you must send a POST request to the REST endpoint, containing the viewport definition as JSON structure in the request body.
The above is a rather minimal example where only pages are enabled in a space (whereas blogposts are not) and hierarchical page paths are used.
Get a single Viewport
You can always retrieve a complete example for the config JSON structure by sending a GET request:
Get all viewports
Available JSON fields
|Name||API Default Value||Required||Description|
|<empty>||When creating a new viewport this field should NOT be contained in the config structure.|
The value of the Domain Name field in the viewport config UI.
|The ID of the theme to use for the new viewport.|
|This should either be removed or set to "|
|<empty>||These have no effect when creating a new viewport. It is recommended to omit these fields.|
The path prefix your viewport will be available at. Only a single viewport per domain name can have a blank path prefix.
In the viewport config UI this defaults to the lowercase space key with a leading slash.
|This must be set to "|
|The key of the space you want to assign the viewport to. Must be the same as in the POST URL.|
|false||Define what content your viewport provides. Make sure to set at least one of them to "|
The path prefixes for pages and blogposts. If both pages and blog posts are enabled these must NOT be identical.
In the viewport config UI the prefix for pages is empty by default and the prefix for blogposts is "
Defines how page URLs are created. There are two options:
Defines how blog post URLs are created. Currently only "
|<empty>||Should NOT be included when creating a new viewport.|