Accessing the model service directly

Note: the example URLs point to a test server that will be shut down soon. You need to replace the hostname and port with the correct data for your environment.


Model types

The model service currently supports 2 model types:

  • R2 (short for DXA R2): this is the new JSON format that is generated by the DXA R2 TBBs
  • DD4T: the DD4T 2.0 JSON format generated by the DD4T 2.* TBBs

The R2 JSON is more compact so it may be a bit faster. Also, links in the rich text fields are pre-resolved in the service.

Simple page request

Retrieves the page model and if necessary converts to the R2 model type.


Format:

http(s)://hostname:port/PageModel/tcm/<publicationId>/<url>


Example:

http://ec2-52-17-130-35.eu-west-1.compute.amazonaws.com:8089/PageModel/tcm/8//en/dxa2.html


Note that the URLs start with a slash as well, so you would normally see 2 slashes after the publication ID.


PageModel in R2 format

This is the default model type, so it is effectively the same as the previous format.

Format:

http(s)://hostname:port/PageModel/tcm/<publicationId>/<url>?modelType=R2


Example:

http://ec2-52-17-130-35.eu-west-1.compute.amazonaws.com:8089/PageModel/tcm/8//en/dxa2.html?modelType=R2


PageModel in DD4T format

Format:

http(s)://hostname:port/PageModel/tcm/<publicationId>/<url>?modelType=DD4T


Example:

http://ec2-52-17-130-35.eu-west-1.compute.amazonaws.com:8089/PageModel/tcm/8//en/dxa2.html?modelType=DD4T


PageModel in raw format

Raw format means the JSON is passed on 'as is': you see exactly what is published to the broker database.

Format:

http(s)://hostname:port/PageModel/tcm/<publicationId>/<url>?raw=true

Example:

http://ec2-52-17-130-35.eu-west-1.compute.amazonaws.com:8089/PageModel/tcm/8//en/dxa2.html?raw=true


Expanding included component presentations


http://ec2-52-17-130-35.eu-west-1.compute.amazonaws.com:8089/PageModel/tcm/8//en/dxa2.html?includes=INCLUDE