XML Policy API Setup Guide

Prev Next

The XML Policy API allows users to create new XML validation policies in Glasswall Halo.

Creating a new XML Policy

1. Make a POST request to the XML Policy API

To submit a new ICAP profile, send a POST request to the api/v1/xml-policies/<policy-name> endpoint. Include a JSON request body that contains the policy. The policy name is specified as a path param.

Example:

{
    "policySettings": {
        "EnableWarningHandling": false,
        "BlockedTags": [
            "/XInclude:include",
            "/XSL/Transform:stylesheet"
        ],
        "AllowedEncodings": [
            "utf-8",
            "utf-16",
            "iso-8859-1"
        ],
        "AllowEmptyEncoding": true,
        "AllowDoctypeInCData": false
    }
}

If the request body is valid, the response will contain a summary of the newly created policy.

2. Use the policy in the XML Validation API

Heading back to the XML Validation API, the saved policy can be utilised via the policyName query param.

Example POST request: /api/v1/validate-xml?policyName=<policy-name>.

If desired, a dynamic policy can be used. Provide a JSON value to the multipart/form field labelled policy. If no policy name and no dynamic policy is specified, the default policy is used.

Learn more

XML Policy Management API Documentation

XML Validation API Documentation