Trigger a JSON layout rendering


SXA enables you to model your data in JSON (JavaScript Object Notation). For example, if you want to build a mobile app and feed it with SXA content, you can edit the JSON content on the page and have output content in JSON instead of HTML.

To trigger JSON output, you can:

  • Trigger JSON output using device id .You can include the device id in the URL. Use sc_device to change the device in which the website is displayed. You can use the device name or the device id. For example, if you have a JSON layout defined for this page:


    Modify it by adding the sc_device query string:




  • Trigger a device change with HTTP headers using HTTP header .Set the application/json value for the ContentType header. For example, invoke with Powershell:

    Invoke-WebRequest "http://sxa18//json-content" -ContentType "application/json"