Patch display template
1 min
PATCH
/_cms/v1/displaytemplates/{key}
Path Parameters
- keystringrequiredDescription
Header Parameters
- Preferstring[]Example
[ "return=representation" ]
Description - If-MatchstringDescription
- If-Unmodified-Sincestring<http-date>DescriptionFormathttp-date
Responses
200
- DisplayTemplateDescription
- keystringDescriptionMin Length2Max Length255Pattern^[A-Za-z][_0-9A-Za-z]+$
- displayNamestringrequiredDescriptionMin Length1Max Length255
- nodeTypestringDescriptionMin Length2Max Length50Pattern^[A-Za-z][_0-9A-Za-z]+$
- baseTypestringDescription
- contentTypestringDescription
- isDefaultbooleanDescription
- createdstring<date-time>DescriptionFormatdate-time
- createdBystringDescription
- lastModifiedstring<date-time>DescriptionFormatdate-time
- lastModifiedBystringDescription
- settingsmap<string, DisplaySetting>Description
Response Headers
- ETagstringDescription
- Last-Modifiedstring<http-date>DescriptionFormathttp-date
- Preference-Applied
204
400
401
403
404
412
500
curl
curl --request PATCH \
--url /_cms/v1/displaytemplates/{key} \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/merge-patch+json");
var requestOptions = {
method: 'PATCH',
headers: myHeaders,
redirect: 'follow'
};
fetch("/_cms/v1/displaytemplates/{key}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("/_cms/v1/displaytemplates/{key}")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Patch.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/merge-patch+json"
response = http.request(request)
puts response.read_body
python
import requests
import json
url = "/_cms/v1/displaytemplates/{key}"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/merge-patch+json'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
200
// OK
{
"key": "",
"displayName": "",
"nodeType": "",
"baseType": "",
"contentType": "",
"isDefault": false,
"created": "",
"createdBy": "",
"lastModified": "",
"lastModifiedBy": "",
"settings": ""
}204
// No Content
400
// Bad Request
401
// Unauthorized
403
// Forbidden
404
// Not Found
412
// Precondition Failed
500
// Internal Server Error