Custom headers file format

ZIP file import validation

When you import custom headers in ION Desk, the file is validated using this schema:

{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "$id": "http://json-schema.org/draft-06/schema#",
  "title": "Custom Headers Schema",
  "type": "object",
  "properties": {
    "customHeaders": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "objectName": {
            "type": "string"
          },
          "headers": {
            "type": "array",
            "maxItems": 3,
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^Custom_[a-zA-Z0-9]+$",
                  "maxLength": 250
                },
                "dataType": {
                  "enum": [
                    "String",
                    "Integer",
                    "Decimal",
                    "Boolean",
                    "Date",
                    "DateTime"
                  ]
                }
              },
              "required": [
                "name",
                "dataType"
              ]
            }
          }
        },
        "required": [
          "objectName",
          "headers"
        ]
      }
    }
  }
}

This is an example of a custom headers file:

{
  "customHeaders": [
    {
      "objectName": "Process.PlannedTransfer",
      "headers": [
        {
          "name": "Custom_processItemID",
          "dataType": "String"
        }
      ]
    },
    {
      "objectName": "Sync.PlannedTransfer",
      "headers": [
        {
          "name": "Custom_syncItemID",
          "dataType": "String"
        },
        {
          "name": "Custom_syncUPCID",
          "dataType": "String"
        }
      ]
    },
    {
      "objectName": "Inventory_Repo",
      "headers": [
        {
          "name": "Custom_itemNumber",
          "dataType": "Integer"
        }
      ]
    },
    {
      "objectName": "MITMAS",
      "headers": [
        {
          "name": "Custom_attributeModel",
          "dataType": "String"
        }
      ]
    }
  ]
}

Data Catalog API validation

When you register an object with the Data Catalog through the POST /v1/object API, custom headers for that object are validated against this schema:

{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "$id": "http://json-schema.org/draft-06/schema#",
  "title": "Custom Headers Schema",
  "type": "object",
  "properties": {
    "customHeader": {
      "type": "object",
      "properties": {
        "objectName": {
          "type": "string"
        },
        "headers": {
          "objectName": {
            "type": "string"
          },
          "headers": {
            "type": "array",
            "maxItems": 3,
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^Custom_[a-zA-Z0-9]+$",
                  "maxLength": 250
                },
                "dataType": {
                  "enum": [
                    "String",
                    "Integer",
                    "Decimal",
                    "Boolean",
                    "Date",
                    "DateTime"
                  ]
                }
              },
              "required": [
                "name",
                "dataType"
              ]
            }
          },
          "required": [
            "objectName",
            "headers"
          ]
        }
      }
    }
  }
}

This is an example of the input body for the API that is used to register an object with custom headers:

{
  "name":"mySalesOrder",
  "type":"JSON",
  "schema": {...},
  "properties":{...},
  "customHeader": {
        "objectName": "mySalesOrder",
        "headers": [
            {
                "name": "Custom_salesOrderId",
                "dataType": "Integer"
            },
            {
                "name": "Custom_shipToAddress",
                "dataType": "String"
            }
        ]
    }
}

Properties

This table shows the properties in the file:

Property Description
customHeaders An array of JSON objects. Each JSON object contains the name of an object schema and the headers to be defined for that specified object.

Optional.

Note: Applies to the zip file import only.
CustomHeader A JSON object that contains the object name and the list of headers to be defined for that object.

Optional.

Note: Applies to the POST API only.
objectName The name of the object for which the custom headers should be defined.

For BODs, you must specify the full object name as opposed to only the noun.

For example, Sync.SalesOrder.

Required.

headers An array of headers to be defined for the object.

A maximum of three custom headers may exist per object.

Required, but the array can be empty. If an empty array is found, any existing custom headers for the associated object are deleted.

name The name of the custom header.

The name must begin with Custom_ and can only contain alphanumeric characters, without any spaces. It cannot exceed 250 characters in length.

Required.

dataType The data type that the custom header value is expected to have.

These are possible data types:

  • String
  • Integer
  • Decimal
  • Boolean
  • Date
  • DateTime
Note: These are case-sensitive and must match exactly to pass validation.

Required.