Import

2 minute read

For an XML file, use POST or PUT.

Operation Relative URL Description
Import /document Will import an XML file and create an ADH document with a random UUID identifier.
Import /document/{docId} Will import an XML file and create an ADH document with the given identifier.

For an Excel file, use POST with media type “multipart/form-data” and relative URL /document.
The Excel file will be converted into XML format during import.

The multipart structure must contain a “file” part with the Excel file as a stream, with media type
application/vnd.ms-excel
(for an .xls file), or
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
(for an .xlsx file).

Other supported parts (all optional) are:

Part Description
docId Document identifier
fileName File name
params Additional parameters that will appear as XML elements in the generated XML structure.

Details about Excel params

When provided, the “params” multipart part must be a string of key-value pairs delimited by semicolon. Each pair consists of a key and a value, separated by an equal sign.

For example:
mapping=GENERALI;uwYear=1997;contractRef=900491

  • Each key will become a tag/field added at the top of the input data (XML) created from the spreadsheet.
  • Each value will become the value of that tag.

This gives full flexibility to include any additional data desired, over and above the data in the spreadsheet.

Example XML input resulting from a REST call with fileName=’TestExcel5.xlsx’, params=’mapping=GENERALI;uwYear=1997;contractRef=900491’ and a spreadsheet where the first tab is named ‘Sheet1’:

<Output>
   <fileName>TestExcel5.xlsx</fileName>
   <params>
      <mapping>GENERALI</mapping>
      <uwYear>1997</uwYear>
      <contractRef>900491</contractRef>
   </params>
   <pages>
      <page name="Sheet1"
   ....

From this one can create Input Pattern fields ‘fileName’, ‘mapping’, ‘uwYear’, and ‘contractRef’, and use these in the transformation.

Keys may not contain: whitespace, null characters, semicolon, equal sign or single quote.

Values may be empty.

If - and only if - the value contains a semicolon, an equal sign, a leading single quote, or a leading or trailing whitespace, then the value must be surrounded by single quotes AND any single quote in the value itself must be replaced by two single quotes.

For example, if the contractRef is
310560A
then it must be included in the ‘params’ parameter as
contractRef=310560A

If the contractRef is
310=560A
then it must be included in the ‘params’ parameter as
contractRef='310=560A'

If the contractRef is
310’560A
then it must be included in the ‘params’ parameter as
contractRef=310'560A

If the contractRef is
‘310560A
then it must be included in the ‘params’ parameter as
contractRef='''310560A'

Import and Transform

Same as above, except the relative URL is
/transform.