Use of View Templates for the Operational Reporting API

Reporting view templates are used to specify the filters that determine what data will be returned in response to an API request using the Operational Reporting API. A reporting view template specifies the type of transaction to report on, the reporting fields to be included in the API response, and selection filters to select relevant transactions for inclusion.

For example, a view template for invoices could specify filters like updatedDateFrom > 2017-10-01T00:00:00Z to report on invoices updated after October 1, 2017 or Status = Approved to report on invoices in Approved status. The response to an reporting API call would include the fields specified in the view template from approved invoice transactions updated after October 1, 2017.

Possible View Template Actions

  • List the names and details of reporting views currently in the system for a particular document type using the GET /viewTemplates endpoint of the Operational Reporting for Procurement - View Management API. You can specify the desired document type and status in the URL using the optional documentType and status parameters.

    GET {{runtime_url}}/viewTemplates?realm={realm}&documentType={documentType}&status={status}
  • Create a custom reporting view template using the POST /viewTemplates/{template_name} endpoint of the Operational Reporting for Procurement - View Management API. Name the custom view template in the URL and provide field and filter data in the request body. For a detailed example, see Sample API Request to Create a Custom View Template.

    POST {{runtime_url}}/viewTemplates/{template_name}?realm={realm}
  • Modify an existing custom view template using the POST /viewTemplates/{template_name}/patch endpoint of the Operational Reporting for Procurement - View Management API. Provide the name of the custom view template to be modified in the URL, and provide fields and filter modifications in the request body.

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

    To change the status of a custom reporting view template using this endpoint, pass the status parameter in the request body.

    POST {{runtime_url}}/viewTemplates/{template_name}/patch?realm={realm}
    Request body
    {
    	"status":"deactivated"
    }
    				
  • View the details of a particular reporting view template using the GET /viewTemplates/{template_name} endpoint of the Operational Reporting for Procurement - View Management API.

    GET {{runtime_url}}/viewTemplates/{template_name}?realm={realm}