How to customize Sitecore layout service json response completely by removing even Sitecore, context and route level and only return the custom data in the response?
For one of my POCs, I have the requirement to return the following result when we invoke the layout service API.
{
"pageid": 1,
"backgroundimagetype":"link/base64",
"backgroundimage": null,
"backgroundimagealttext":"Header",
"tenantid": 1,
"countryid": 1,
"countryname": "Switzerland",
"languageid": 1,
"languagecode": "ENG",
"icon":{
"type":"anchor/image/base64",
"attributes":[
{
"name":"href",
"value":"#"
},
{
"name":"class",
"value":"d-block"
}
],
"subtype":"image/text",
"subtypeattributes":[
{
"name":"src",
"value":"#"
},
{
"name":"class",
"value":"d-block"
},
{
"name":"alt",
"value":"arrow"
}
]
}
- I have the login page which contains only fields.
- If I simply invoke the API then the result should be as above without even Sitecore, Context, and Route nodes. Is it possible to achieve this? If yes how I can achieve it? Someone can please help with this?
API that I'm hitting is: https://sc1010.sc/sitecore/api/layout/render/jss?item={97479C6B-BB30-4A15-AFD1-2C89F207E9D6}&sc_lang=en&sc_apikey=35537f26-6b0a-4a4f-8b76-02d823e4a4fe
Version: Sitecore 10.1