19 Aug 2020
Technology
1
min read
Garrad Stacey
,
Back-end Developer
Generally speaking, we would never actively call the Layout Service directly, but sometimes it's good for testing purposes to be able to get a raw data dump to ensure data is actually being given in the correct format (or at all) before looking elsewhere.
How to use it for testing
The endpoint that powers the layout service sits at the URL of: {siteName}/sitecore/api/layout/render/jss
This requires two additional pieces of information in query string form to supply data:
The path of the item requested. For example a sitecore/content/home/sample would use the path /sample
The GUID of the API key. This is a value that is configured in Sitecore when first setting up JSS
With these in mind, the URL to request the data can be built like this, {sitename}/sitecore/api/layout/render/jss/?item=sample&sc_apikey={00000000-0000-0000-0000-000000000000}
Working with Codehouse
At Codehouse we continually work on exciting design and build Sitecore projects. Our development team use best practices to build robust and engaging Sitecore websites. Get in touch to find out more.
More articles by this author: Introduction to Unicorn