import requests
url = "https://{FUSION_HOST}/api/templating/templates/{id}/metadata"
payload = {
"exactMatch": False,
"metadata": {
"imageUrl": "https://example.com/image_file",
"pageDescription": "This page contains data that is searched.",
"pageKeywords": ["keyword1, keyword2"],
"pageTitle": "<string>",
"pageUrl": "https://example.com/page_location"
},
"trigger": {
"exact": True,
"filters": [
{
"inheritable": True,
"key": "key1",
"value": "value1"
}
]
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.post("https://{FUSION_HOST}/api/templating/templates/{id}/metadata")
.header("Content-Type", "application/json")
.body("{\n \"exactMatch\": false,\n \"metadata\": {\n \"imageUrl\": \"https://example.com/image_file\",\n \"pageDescription\": \"This page contains data that is searched.\",\n \"pageKeywords\": [\n \"keyword1, keyword2\"\n ],\n \"pageTitle\": \"<string>\",\n \"pageUrl\": \"https://example.com/page_location\"\n },\n \"trigger\": {\n \"exact\": true,\n \"filters\": [\n {\n \"inheritable\": true,\n \"key\": \"key1\",\n \"value\": \"value1\"\n }\n ]\n }\n}")
.asString();const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
exactMatch: false,
metadata: {
imageUrl: 'https://example.com/image_file',
pageDescription: 'This page contains data that is searched.',
pageKeywords: ['keyword1, keyword2'],
pageTitle: '<string>',
pageUrl: 'https://example.com/page_location'
},
trigger: {exact: true, filters: [{inheritable: true, key: 'key1', value: 'value1'}]}
})
};
fetch('https://{FUSION_HOST}/api/templating/templates/{id}/metadata', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://{FUSION_HOST}/api/templating/templates/{id}/metadata")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"exactMatch\": false,\n \"metadata\": {\n \"imageUrl\": \"https://example.com/image_file\",\n \"pageDescription\": \"This page contains data that is searched.\",\n \"pageKeywords\": [\n \"keyword1, keyword2\"\n ],\n \"pageTitle\": \"<string>\",\n \"pageUrl\": \"https://example.com/page_location\"\n },\n \"trigger\": {\n \"exact\": true,\n \"filters\": [\n {\n \"inheritable\": true,\n \"key\": \"key1\",\n \"value\": \"value1\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{FUSION_HOST}/api/templating/templates/{id}/metadata"
payload := strings.NewReader("{\n \"exactMatch\": false,\n \"metadata\": {\n \"imageUrl\": \"https://example.com/image_file\",\n \"pageDescription\": \"This page contains data that is searched.\",\n \"pageKeywords\": [\n \"keyword1, keyword2\"\n ],\n \"pageTitle\": \"<string>\",\n \"pageUrl\": \"https://example.com/page_location\"\n },\n \"trigger\": {\n \"exact\": true,\n \"filters\": [\n {\n \"inheritable\": true,\n \"key\": \"key1\",\n \"value\": \"value1\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{FUSION_HOST}/api/templating/templates/{id}/metadata",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'exactMatch' => false,
'metadata' => [
'imageUrl' => 'https://example.com/image_file',
'pageDescription' => 'This page contains data that is searched.',
'pageKeywords' => [
'keyword1, keyword2'
],
'pageTitle' => '<string>',
'pageUrl' => 'https://example.com/page_location'
],
'trigger' => [
'exact' => true,
'filters' => [
[
'inheritable' => true,
'key' => 'key1',
'value' => 'value1'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request POST \
--url https://{FUSION_HOST}/api/templating/templates/{id}/metadata \
--header 'Content-Type: application/json' \
--data '
{
"exactMatch": false,
"metadata": {
"imageUrl": "https://example.com/image_file",
"pageDescription": "This page contains data that is searched.",
"pageKeywords": [
"keyword1, keyword2"
],
"pageTitle": "<string>",
"pageUrl": "https://example.com/page_location"
},
"trigger": {
"exact": true,
"filters": [
{
"inheritable": true,
"key": "key1",
"value": "value1"
}
]
}
}
'{
"app": "<string>",
"id": "6a163bd4-5098-466c-22aa-40bf68294303",
"name": "Item-Detail Page",
"all": false,
"priority": 10,
"dirty": true,
"templateDirty": true,
"markedForDeletion": true,
"neverPublished": true,
"type": "landing",
"zoneIds": [
"ab6d0e24-9e7a-35h9-a2e7-5hjl72b8a3ea, 2abc1e65-162d-3a8e-76f0-6a962e0f43c5"
],
"dirtyZoneIds": [
"a3e0e22-9e6a-45h9-a2e7-5hjk72b9a3ea, 5avc1e65-162d-5b8e-92f0-6a962e0f43c5"
],
"metadata": {
"layout": "list"
},
"staging": true,
"published": true,
"startTime": "2024-08-24T14:15:22Z",
"endTime": "2024-08-24T14:15:22Z",
"triggers": [
{
"exact": true,
"filters": [
{
"inheritable": true,
"key": "key1",
"value": "value1"
}
],
"matchMode": "all",
"search": "<string>",
"urlContext": "<string>",
"urlPath": "<string>"
}
]
}This response has no body data.This response has no body data.This response has no body data.This response has no body data.Post zone page metadata using templateId
Submit updates to zone page metadata for a specific template using templateId. Successful changes make the template dirty, and the changes can be published using the /templates/publish/{templateId} endpoint.
import requests
url = "https://{FUSION_HOST}/api/templating/templates/{id}/metadata"
payload = {
"exactMatch": False,
"metadata": {
"imageUrl": "https://example.com/image_file",
"pageDescription": "This page contains data that is searched.",
"pageKeywords": ["keyword1, keyword2"],
"pageTitle": "<string>",
"pageUrl": "https://example.com/page_location"
},
"trigger": {
"exact": True,
"filters": [
{
"inheritable": True,
"key": "key1",
"value": "value1"
}
]
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.post("https://{FUSION_HOST}/api/templating/templates/{id}/metadata")
.header("Content-Type", "application/json")
.body("{\n \"exactMatch\": false,\n \"metadata\": {\n \"imageUrl\": \"https://example.com/image_file\",\n \"pageDescription\": \"This page contains data that is searched.\",\n \"pageKeywords\": [\n \"keyword1, keyword2\"\n ],\n \"pageTitle\": \"<string>\",\n \"pageUrl\": \"https://example.com/page_location\"\n },\n \"trigger\": {\n \"exact\": true,\n \"filters\": [\n {\n \"inheritable\": true,\n \"key\": \"key1\",\n \"value\": \"value1\"\n }\n ]\n }\n}")
.asString();const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
exactMatch: false,
metadata: {
imageUrl: 'https://example.com/image_file',
pageDescription: 'This page contains data that is searched.',
pageKeywords: ['keyword1, keyword2'],
pageTitle: '<string>',
pageUrl: 'https://example.com/page_location'
},
trigger: {exact: true, filters: [{inheritable: true, key: 'key1', value: 'value1'}]}
})
};
fetch('https://{FUSION_HOST}/api/templating/templates/{id}/metadata', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://{FUSION_HOST}/api/templating/templates/{id}/metadata")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"exactMatch\": false,\n \"metadata\": {\n \"imageUrl\": \"https://example.com/image_file\",\n \"pageDescription\": \"This page contains data that is searched.\",\n \"pageKeywords\": [\n \"keyword1, keyword2\"\n ],\n \"pageTitle\": \"<string>\",\n \"pageUrl\": \"https://example.com/page_location\"\n },\n \"trigger\": {\n \"exact\": true,\n \"filters\": [\n {\n \"inheritable\": true,\n \"key\": \"key1\",\n \"value\": \"value1\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{FUSION_HOST}/api/templating/templates/{id}/metadata"
payload := strings.NewReader("{\n \"exactMatch\": false,\n \"metadata\": {\n \"imageUrl\": \"https://example.com/image_file\",\n \"pageDescription\": \"This page contains data that is searched.\",\n \"pageKeywords\": [\n \"keyword1, keyword2\"\n ],\n \"pageTitle\": \"<string>\",\n \"pageUrl\": \"https://example.com/page_location\"\n },\n \"trigger\": {\n \"exact\": true,\n \"filters\": [\n {\n \"inheritable\": true,\n \"key\": \"key1\",\n \"value\": \"value1\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{FUSION_HOST}/api/templating/templates/{id}/metadata",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'exactMatch' => false,
'metadata' => [
'imageUrl' => 'https://example.com/image_file',
'pageDescription' => 'This page contains data that is searched.',
'pageKeywords' => [
'keyword1, keyword2'
],
'pageTitle' => '<string>',
'pageUrl' => 'https://example.com/page_location'
],
'trigger' => [
'exact' => true,
'filters' => [
[
'inheritable' => true,
'key' => 'key1',
'value' => 'value1'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request POST \
--url https://{FUSION_HOST}/api/templating/templates/{id}/metadata \
--header 'Content-Type: application/json' \
--data '
{
"exactMatch": false,
"metadata": {
"imageUrl": "https://example.com/image_file",
"pageDescription": "This page contains data that is searched.",
"pageKeywords": [
"keyword1, keyword2"
],
"pageTitle": "<string>",
"pageUrl": "https://example.com/page_location"
},
"trigger": {
"exact": true,
"filters": [
{
"inheritable": true,
"key": "key1",
"value": "value1"
}
]
}
}
'{
"app": "<string>",
"id": "6a163bd4-5098-466c-22aa-40bf68294303",
"name": "Item-Detail Page",
"all": false,
"priority": 10,
"dirty": true,
"templateDirty": true,
"markedForDeletion": true,
"neverPublished": true,
"type": "landing",
"zoneIds": [
"ab6d0e24-9e7a-35h9-a2e7-5hjl72b8a3ea, 2abc1e65-162d-3a8e-76f0-6a962e0f43c5"
],
"dirtyZoneIds": [
"a3e0e22-9e6a-45h9-a2e7-5hjk72b9a3ea, 5avc1e65-162d-5b8e-92f0-6a962e0f43c5"
],
"metadata": {
"layout": "list"
},
"staging": true,
"published": true,
"startTime": "2024-08-24T14:15:22Z",
"endTime": "2024-08-24T14:15:22Z",
"triggers": [
{
"exact": true,
"filters": [
{
"inheritable": true,
"key": "key1",
"value": "value1"
}
],
"matchMode": "all",
"search": "<string>",
"urlContext": "<string>",
"urlPath": "<string>"
}
]
}This response has no body data.This response has no body data.This response has no body data.This response has no body data.Query Parameters
Body
The page metadata contains the map of metadata elements and trigger.
Response
OK
The order in which this template is processed when multiple templates with the same status (published or staging) are associated with the application. The higher the number, the earlier the template will be used. For example, a template with a priority of 10 is triggered before a template with a priority of 3.
10
The status of the template. If false, the template does not have unpublished changes. If true, this is the staging version of this template and it contains changes that have not yet been published. This only applies to templates and is different from the status of the zone. Even if the associated zone (query profile) for this template is dirty (contains some type of changes that have not yet been published), the template and its status are separate.
This field indicates if the staging version of this template has been marked for deletion, but the deletion has not been completed because it has not been published yet. If true, the template has been marked for deletion, and when it is published, it will actually be deleted. If false, the template has not been marked for deletion.
The comma-delimited list of universal unique identifiers (UUIDs) of the zones (query profiles) that are associated with the template and have unpublished changes. This only applies to zones and is different from the status of the template. Even if the associated template is dirty (contains some type of changes that have not yet been published), the zones and their respective changes are separate.
Was this page helpful?