Sample API Request to Create a Custom View Template

Include the fields and filters for a custom view template within the request body. The following example shows a request to create a custom view template, but you can use similar request body syntax with the POST /viewTemplates/{template_name}/patch endpoint of the Operational Reporting for Sourcing - View Management API for modification requests as well.

POST /viewTemplates/{template_name}?realm={realm}

Example

POST {{runtime_url}}/viewTemplates/myTaskView?realm=myRealm345	

Request body syntax

{
"viewTemplateName":"{template_name}"
"type":"{system | custom}"
"documentType":"{document type}"
"status":"{draft | published | deactivated}"
"selectAttributes":["{field1}","{field2}"{,…}],
"filterExpressions":[
	{"field":"{field name}",
	 "op":"{operator}",
	 "defaultValue":"{value}",
	 "name":"{name}"}										 
	  ...
	]
}
								

Request body example

{
"viewTemplateName":"myTaskView"
"type":"custom"
"documentType":"Task"
"status":"draft"
"selectAttributes":["UniqueName","StatusString","TimeUpdated"],
"filterExpressions":[
	{
	"field":"TimeUpdated",
	"op":"<=",
	"defaultValue":"2017-08-31T00:00:00Z",
	"name":"updatedDateTo"
	},										 
	{
	"field":"TimeUpdated",
	"op":">",
	"defaultValue":"2017-08-01T00:00:00Z",
	"name":"updatedDateFrom"
	},
	{
	"field":"StatusString",
	"op":"IN",
	"defaultValue":["Submitted","Approved"],
	"name":"StatusInList"
	}
]
}