CreateDocumentUsingTemplate API

Creates a new HTML document or a new version of an existing document at the specified path, using an infoRouter template document and XML content data to populate the template fields.

When the target Path does not exist, a new document is created. When it already exists, a new version of that document is created using the template.

Endpoint

/srv.asmx/CreateDocumentUsingTemplate

Methods

Parameters

Parameter Type Required Description
authenticationTicket string Yes Authentication ticket obtained from AuthenticateUser.
Path string Yes Full infoRouter path for the document to create or update (e.g. /MyLibrary/Reports/Summary.htm). If the path does not yet exist, a new document is created. If it already exists, a new version is created.
TemplatePath string Yes Full infoRouter path of the existing HTML template document to use (e.g. /Templates/ReportTemplate.htm). Pass "999" to use a blank/empty template.
xmlContent string Yes XML-formatted data used to populate the template fields. Pass an empty string if no field data is required.

Response

Success Response — New Document Created

<response success="true" error="" DocumentID="42" DocumentName="Summary.htm" />
Attribute Description
success true if the document was created successfully.
DocumentID The integer ID of the newly created document.
DocumentName The name of the created file (.htm extension is added automatically if the path does not end with .html or .htm).

Success Response — New Version Created

<root success="true" />

Error Response

<response success="false" error="Error message" />

Required Permissions


Example

GET Request — Create new document

GET /srv.asmx/CreateDocumentUsingTemplate
  ?authenticationTicket=3f2504e0-4f89-11d3-9a0c-0305e82c3301
  &Path=/MyLibrary/Reports/Q1Summary.htm
  &TemplatePath=/Templates/QuarterlyReport.htm
  &xmlContent=%3Cfields%3E%3Ctitle%3EQ1+2026%3C%2Ftitle%3E%3C%2Ffields%3E
HTTP/1.1

POST Request — Create new document

POST /srv.asmx/CreateDocumentUsingTemplate HTTP/1.1
Content-Type: application/x-www-form-urlencoded

authenticationTicket=3f2504e0-4f89-11d3-9a0c-0305e82c3301
&Path=/MyLibrary/Reports/Q1Summary.htm
&TemplatePath=/Templates/QuarterlyReport.htm
&xmlContent=<fields><title>Q1 2026</title><author>Jane Smith</author></fields>

POST Request — Create new version using blank template

POST /srv.asmx/CreateDocumentUsingTemplate HTTP/1.1
Content-Type: application/x-www-form-urlencoded

authenticationTicket=3f2504e0-4f89-11d3-9a0c-0305e82c3301
&Path=/MyLibrary/Reports/Q1Summary.htm
&TemplatePath=999
&xmlContent=<fields><title>Q1 2026 (revised)</title></fields>

SOAP Request

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
               xmlns:tns="http://tempuri.org/">
  <soap:Body>
    <tns:CreateDocumentUsingTemplate>
      <tns:authenticationTicket>3f2504e0-4f89-11d3-9a0c-0305e82c3301</tns:authenticationTicket>
      <tns:Path>/MyLibrary/Reports/Q1Summary.htm</tns:Path>
      <tns:TemplatePath>/Templates/QuarterlyReport.htm</tns:TemplatePath>
      <tns:xmlContent>&lt;fields&gt;&lt;title&gt;Q1 2026&lt;/title&gt;&lt;/fields&gt;</tns:xmlContent>
    </tns:CreateDocumentUsingTemplate>
  </soap:Body>
</soap:Envelope>

Notes



Error Codes

Error Description
[900] Authentication failed Invalid or missing authentication ticket.
[901] Session expired or Invalid ticket The ticket has expired or does not exist.
Folder not found The destination folder (parent of Path) does not exist or is not accessible.
Document not found The TemplatePath does not refer to an existing document.
This document has been checked out by another user. The document at Path is checked out by a different user; a new version cannot be created.

For detailed documentation visit: https://support.inforouter.com/api-docs/CreateDocumentUsingTemplate