Skip to content

SetFolderAIPreferences API

Sets the infoRouter Connect (AI) preferences of the specified folder from an XML preferences definition. Only the preferences listed in the XML are changed; the ones that are not listed keep their current value.

When the ApplyToSubfolders preference is on, the preferences are also written onto the whole existing subfolder tree, and subfolders created later inherit them at creation time.

Endpoint

/srv.asmx/SetFolderAIPreferences

Methods

  • GET /srv.asmx/SetFolderAIPreferences?authenticationTicket=...&Path=...&xmlPreferences=...
  • POST /srv.asmx/SetFolderAIPreferences (form data)
  • SOAP Action: http://tempuri.org/SetFolderAIPreferences

Parameters

Parameter Type Required Description
authenticationTicket string Yes Authentication ticket obtained from AuthenticateUser.
Path string Yes Full infoRouter path to the folder (e.g. /Finance/Reports).
xmlPreferences string (XML) Yes XML document with an AIPreferences root element and Preference child elements carrying Name and Value attributes. In SOAP this parameter is an XML element, not a string.

Supported Preference Names

Names are case-insensitive.

Preference Name Description
AutoSummarize Summarize new document versions.
AutoDescribe Write the one line description of new document versions.
AutoAbstract Write the longer abstract of new document versions.
AutoExtractKeywords Produce keywords for new document versions.
AutoOCR Read the text out of scanned documents so they become searchable.
AutoClassify Work out the document type of new document versions.
ExtractDataPropertySet Not a switch: the property set read out of every new document version, e.g. INVOICE. Naming one turns extraction on; an empty value turns it off. It must be an existing property set (otherwise 4041), and is stored as the set spells its own name.
AutoExtractData Kept for compatibility; extraction is on exactly when ExtractDataPropertySet names a set. off clears the set. on is refused with 4000 unless a set is named, in the same call or already on the folder.
ScrubPII Scrub PII before document text is handed to the AI provider.
ApplyToSubfolders Apply the preferences to the subfolder tree as well (see Notes).

Switching one on does not process the documents already in the folder. Preferences take effect for documents uploaded, checked in, imported, copied or moved into the folder afterwards - a copied or moved document is not asked again for what its AIEnhanced flags say it already has. To produce content for a document already there, ask for it directly with GetConnectProfile.

Every answer is its own switch, and asks for nothing else. A folder that switches on AutoDescribe alone gets a description - not a summary, keywords or a document type along with it. Switching several on still costs one call, because one call answers all of them; see GetFolderAIPreferences for exactly what gets queued.

There is no AutoProfile. Pre-release builds carried one preference standing for AutoDescribe, AutoSummarize, AutoExtractKeywords and AutoClassify together; name the ones you want instead. AutoProfile is an unknown preference name now and is ignored like any other.

Extraction reads the folder's own ExtractDataPropertySet. Until 9.0 builds, AutoExtractData took the property set from the folder rules' AutoPromptPropertysetName - the set a user is asked to fill in on upload. That rule is no longer used for extraction: name the set here.

Supported Values

on and off. For convenience true/false, yes/no and 1/0 are also accepted. Values are case-insensitive; any other value fails the call. ExtractDataPropertySet takes a property set name instead.

Example xmlPreferences

<AIPreferences>
  <Preference Name="AutoSummarize" Value="on" />
  <Preference Name="AutoDescribe" Value="on" />
  <Preference Name="AutoAbstract" Value="off" />
  <Preference Name="AutoExtractKeywords" Value="on" />
  <Preference Name="ScrubPII" Value="on" />
  <Preference Name="ApplyToSubfolders" Value="on" />
</AIPreferences>

Response

Success Response

<response success="true" error="" />

Error Response

<response success="false" error="Invalid value for the 'AUTOSUMMARIZE' preference. Valid values: on, off" />

Required Permissions

The calling user must have the Set Folder Rules permission on the folder. When ApplyToSubfolders is on, the permission is checked on every subfolder as well; the first subfolder the user may not configure aborts the operation and returns an access error. Subfolders processed before that point keep the new preferences.


Example

GET Request

GET /srv.asmx/SetFolderAIPreferences
  ?authenticationTicket=3f2504e0-4f89-11d3-9a0c-0305e82c3301
  &Path=/Finance/Reports
  &xmlPreferences=%3CAIPreferences%3E%3CPreference%20Name%3D%22AutoSummarize%22%20Value%3D%22on%22%2F%3E%3C%2FAIPreferences%3E
HTTP/1.1

POST Request

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

authenticationTicket=3f2504e0-4f89-11d3-9a0c-0305e82c3301
&Path=/Finance/Reports
&xmlPreferences=<AIPreferences><Preference Name="AutoSummarize" Value="on"/></AIPreferences>

SOAP Request

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
               xmlns:tns="http://tempuri.org/">
  <soap:Body>
    <tns:SetFolderAIPreferences>
      <tns:AuthenticationTicket>3f2504e0-4f89-11d3-9a0c-0305e82c3301</tns:AuthenticationTicket>
      <tns:Path>/Finance/Reports</tns:Path>
      <tns:xmlPreferences>
        <AIPreferences>
          <Preference Name="AutoSummarize" Value="on" />
        </AIPreferences>
      </tns:xmlPreferences>
    </tns:SetFolderAIPreferences>
  </soap:Body>
</soap:Envelope>

JavaScript

Every call answers XML with HTTP 200, success or not, so success is the thing to branch on and errorCode is the number to report.

async function call(action, params) {
  const response = await fetch(`/srv.asmx/${action}?${new URLSearchParams(params)}`);
  const root = new DOMParser()
    .parseFromString(await response.text(), 'text/xml')
    .documentElement;

  if (root.getAttribute('success') !== 'true') {
    throw new Error(`${root.getAttribute('errorCode')}: ${root.getAttribute('error')}`);
  }
  return root;
}

Writes the AI switches on a folder. Only the preferences named are changed; the rest keep their values, so <AIPreferences /> is a valid no-op.

await call('SetFolderAIPreferences', {
  authenticationTicket: ticket,
  Path: '/Finance/Reports',
  xmlPreferences:
    '<AIPreferences>' +
      '<Preference Name="AutoSummarize" Value="on" />' +
      '<Preference Name="ApplyToSubfolders" Value="on" />' +
    '</AIPreferences>'
});

Every Value is on or off; anything else is refused with 4000 and a message naming the two. ApplyToSubfolders is itself one of the preferences, and switching it on writes the whole set onto the existing subfolder tree - including ApplyToSubfolders, so the subfolders carry it too.

xmlPreferences is declared non-nullable on the REST action, so an empty one is refused by model binding with HTTP 400 before the operation runs. Send <AIPreferences /> to mean "change nothing".

Notes

  • The preferences are merged onto the values currently in effect for the folder, so a call that lists a single preference leaves the others untouched.
  • ApplyToSubfolders is itself a stored preference, not a one-off switch: while it is on, the folder's preferences are copied to every subfolder created afterwards. Turning it off stops that inheritance but leaves the values already written onto the subfolders in place.
  • Unknown Preference names are ignored, so a newer client can send preferences an older server does not know yet.
  • The automatic operations additionally require infoRouter Connect to be configured on the server (AppSettings:IRConnect); preferences that are on have no effect while Connect is unconfigured or not licensed (the maintenance contract has ended).


Error Codes

The errorCode values this operation returns, checked against a running server:

errorCode When
4010 the ticket is expired or unknown, or there is no ticket at all - the anonymous user is told "Anonymous users cannot perform this action"
4041 no folder at that path - including one the caller may not see
4000 a Value is neither on nor off, or xmlPreferences is not well-formed XML
4030 the caller may not change this folder's preferences
HTTP 400 xmlPreferences was empty; it is required, so send <AIPreferences />
Error Description
[900] Authentication failed Invalid or missing authentication ticket.
[901] Session expired or Invalid ticket The ticket has expired or does not exist.
[903]Required parameter.'Path' The Path parameter was empty.
[903]Required parameter.'xmlPreferences' The xmlPreferences parameter was empty or not well-formed XML.
Invalid value for the '...' preference. Valid values: on, off A Preference element carried a value that is not a recognized switch.
Folder not found The specified path does not resolve to an existing folder.
Access denied The user may not set the rules of the folder or of one of its subfolders.
SystemError:... An unexpected server-side error occurred.