import requests
url = "https://{FUSION_HOST.com}/api/templating/renderDSL/{app}"
payload = {
"context": {},
"facets": {
"fields": [
{
"domain": {
"additionalFilters": [{ "type": "<string>" }],
"excludedFiltersByName": ["<string>"]
},
"ensuredValues": ["<string>"],
"field": "<string>",
"limit": 123,
"minCount": 123,
"missing": True,
"offset": 123,
"prefix": "<string>",
"sort": "count"
}
],
"groupFacets": True,
"groupingMethod": "header_doc",
"ranges": [
{
"domain": {
"additionalFilters": [{ "type": "<string>" }],
"excludedFiltersByName": ["<string>"]
},
"end": "<string>",
"field": "<string>",
"gap": "<string>",
"hardEnd": True,
"include": ["all"],
"minCount": 123,
"other": ["after"],
"start": "<string>"
}
]
},
"params": {},
"queryDefinition": {
"boostsByQuery": [
{
"boost": 123,
"query": { "type": "<string>" },
"type": "<string>"
}
],
"boostsByValues": [
{
"boosts": [
{
"boost": 123,
"key": "<string>"
}
],
"field": "<string>"
}
],
"filters": [{ "type": "<string>" }],
"groupedFilters": [{ "type": "<string>" }],
"groupedQuery": { "type": "<string>" },
"main": { "type": "<string>" },
"namedFilters": [
{
"name": "<string>",
"query": { "type": "<string>" }
}
],
"userQuery": "<string>"
},
"results": {
"cursor": "<string>",
"fields": ["<string>"],
"group": {
"field": "<string>",
"leaderStrategy": { "type": "<string>" },
"size": 123,
"sort": [
{
"order": "asc",
"query": { "type": "<string>" },
"type": "expression",
"value": "<string>"
}
]
},
"highlight": {
"count": 123,
"defaultHighlight": True,
"fields": ["<string>"],
"length": 123,
"post": "<string>",
"pre": "<string>"
},
"includeRawResponse": True,
"returnScore": True,
"size": 123,
"sort": [
{
"order": "asc",
"query": { "type": "<string>" },
"type": "expression",
"value": "<string>"
}
],
"start": 123
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"templateId": "441eb3be-7de6-470a-8141-e416a15c7db1",
"rendered": [
{
"zone": {
"name": "Results List",
"id": "6a092bd4-5098-466c-94aa-40bf68294303",
"type": "result-list",
"queryProfile": "query-profile-name",
"omitFilters": false,
"dirty": false,
"neverPublished": false,
"metadata": {
"image": "image-id",
"secondary": "_text_",
"primary": "primary-metadata-id",
"layout": "grid"
}
},
"inTemplates": [
"e123f4bc-5e7e-46dd-9be8-71a4f73e511a, 8084969c-bd23-40f7-9acf-c68d6798bec2, 441eb3be-7de6-470a-8141-e416a15c7db1, fb148491-b39e-46d1-af33-44cd964d8ee0"
],
"staging": false,
"published": false,
"layout": "grid"
}
],
"render": {
"response": {
"docs": [
"<string>"
],
"numFound": 123,
"start": 123,
"maxScore": 123,
"numFoundExact": true
}
},
"responseHeader": {
"zkConnected": true,
"QTime": 123,
"totalTime": 123,
"params": {
"_stateVer_": "your-app-name:version",
"lw.pipelineId": "<string>",
"start": 3,
"params": "\"dictionary[\\\"key1\\\" : \\\"value1\\\", \\\"key2\\\" : [\\\"one\\\", \\\"two\\\", \\\"a\\\", \\\"B\\\", \\\"bubbles\\\"], \\\"key3\\\" : [\\\"five bubbles\\\", \\\"sunny\\\"], \\\"key4\\\" : \\\"value4\\\"\",",
"rows": 10,
"version": "2.2",
"queryProfileID": "query-profile",
"isFusionQuery": true,
"defType": "eDisMax",
"templateTypes": "landing",
"showInactive": true,
"shards.preference": "<string>",
"wt": "json",
"staging": true,
"fusionQueryId": "fusion-query-id"
}
},
"status": 0
}Retrieve and render the template for the given navigation state.
The navigation state is determined from the DSL object by the userQuery (for the search terms) and the filters (for the filter values).By default will only trigger published versions of templates; specify staging=true to instead trigger staging versions of templates. The provided DSL request object + any additional request parameters are passed through to each query profile when rendering each zone.
import requests
url = "https://{FUSION_HOST.com}/api/templating/renderDSL/{app}"
payload = {
"context": {},
"facets": {
"fields": [
{
"domain": {
"additionalFilters": [{ "type": "<string>" }],
"excludedFiltersByName": ["<string>"]
},
"ensuredValues": ["<string>"],
"field": "<string>",
"limit": 123,
"minCount": 123,
"missing": True,
"offset": 123,
"prefix": "<string>",
"sort": "count"
}
],
"groupFacets": True,
"groupingMethod": "header_doc",
"ranges": [
{
"domain": {
"additionalFilters": [{ "type": "<string>" }],
"excludedFiltersByName": ["<string>"]
},
"end": "<string>",
"field": "<string>",
"gap": "<string>",
"hardEnd": True,
"include": ["all"],
"minCount": 123,
"other": ["after"],
"start": "<string>"
}
]
},
"params": {},
"queryDefinition": {
"boostsByQuery": [
{
"boost": 123,
"query": { "type": "<string>" },
"type": "<string>"
}
],
"boostsByValues": [
{
"boosts": [
{
"boost": 123,
"key": "<string>"
}
],
"field": "<string>"
}
],
"filters": [{ "type": "<string>" }],
"groupedFilters": [{ "type": "<string>" }],
"groupedQuery": { "type": "<string>" },
"main": { "type": "<string>" },
"namedFilters": [
{
"name": "<string>",
"query": { "type": "<string>" }
}
],
"userQuery": "<string>"
},
"results": {
"cursor": "<string>",
"fields": ["<string>"],
"group": {
"field": "<string>",
"leaderStrategy": { "type": "<string>" },
"size": 123,
"sort": [
{
"order": "asc",
"query": { "type": "<string>" },
"type": "expression",
"value": "<string>"
}
]
},
"highlight": {
"count": 123,
"defaultHighlight": True,
"fields": ["<string>"],
"length": 123,
"post": "<string>",
"pre": "<string>"
},
"includeRawResponse": True,
"returnScore": True,
"size": 123,
"sort": [
{
"order": "asc",
"query": { "type": "<string>" },
"type": "expression",
"value": "<string>"
}
],
"start": 123
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"templateId": "441eb3be-7de6-470a-8141-e416a15c7db1",
"rendered": [
{
"zone": {
"name": "Results List",
"id": "6a092bd4-5098-466c-94aa-40bf68294303",
"type": "result-list",
"queryProfile": "query-profile-name",
"omitFilters": false,
"dirty": false,
"neverPublished": false,
"metadata": {
"image": "image-id",
"secondary": "_text_",
"primary": "primary-metadata-id",
"layout": "grid"
}
},
"inTemplates": [
"e123f4bc-5e7e-46dd-9be8-71a4f73e511a, 8084969c-bd23-40f7-9acf-c68d6798bec2, 441eb3be-7de6-470a-8141-e416a15c7db1, fb148491-b39e-46d1-af33-44cd964d8ee0"
],
"staging": false,
"published": false,
"layout": "grid"
}
],
"render": {
"response": {
"docs": [
"<string>"
],
"numFound": 123,
"start": 123,
"maxScore": 123,
"numFoundExact": true
}
},
"responseHeader": {
"zkConnected": true,
"QTime": 123,
"totalTime": 123,
"params": {
"_stateVer_": "your-app-name:version",
"lw.pipelineId": "<string>",
"start": 3,
"params": "\"dictionary[\\\"key1\\\" : \\\"value1\\\", \\\"key2\\\" : [\\\"one\\\", \\\"two\\\", \\\"a\\\", \\\"B\\\", \\\"bubbles\\\"], \\\"key3\\\" : [\\\"five bubbles\\\", \\\"sunny\\\"], \\\"key4\\\" : \\\"value4\\\"\",",
"rows": 10,
"version": "2.2",
"queryProfileID": "query-profile",
"isFusionQuery": true,
"defType": "eDisMax",
"templateTypes": "landing",
"showInactive": true,
"shards.preference": "<string>",
"wt": "json",
"staging": true,
"fusionQueryId": "fusion-query-id"
}
},
"status": 0
}Fusion application name that contains the templates.
This field indicates if the request is set to retrieve published or unpublished (staging) templates. The default of false retrieves published templates. If set to true, the request retrieves unpublished (staging) templates.
Comma-separated list of template types, indicating which possible types of templates to trigger (e.g. landing, item-detail...)
DSL request, used to determine navigation state and will be passed through to the indicated query profiles when rendering each zone.
OK
The universal unique identifier (UUID) of the triggered template containing the rendered zones.
"441eb3be-7de6-470a-8141-e416a15c7db1"
Show child attributes
Show child attributes
Show child attributes
The status of the response. A value of 0 indicates success.
0
Was this page helpful?