Import content file

Create a text asset with custom content for use by the Call external API automation. For example, use this utility to generate a JSON or XML sidecar file for assets.

ImportContentFile: function (_oOptions, _fCallbackSuccess, _fCallBackFail)
+ _oOptions.FileName:
+ _oOptions.FolderID:
+ _oOptions.Content:
+ _oOptions.ImportRetries:
+ _oOptions.ImportMinWaitBeforeRetry:
+ _oOptions.ImportMaxWaitBeforeRetry:

📘

Note

This utility is available beginning in Orange Logic Milan.

Request parameter

The Options object uses the following attributes:

AttributeTypeDescriptionDefault valueRequired
FileNamestring

The title of the asset that will be created.

ℹ️ Note If ImportContentFile runs more than once with the same file name and folder ID, the new data is saved as a new version of the original asset.
undefinedyes
FolderIDstringThe record ID of the folder where the asset will be created.undefinedyes
ContentstringThe text that will be the content of the new asset.undefinedyes
ImportRetriesnumberThe number of import retry attempts.3no
ImportMinWaitBeforeRetrynumberThe minimum number of minutes to wait before an import retry.100no
ImportMaxWaitBeforeRetrynumberThe maximum number of minutes to wait before an import retry.1000no
Example
Utils.ImportContentFile(
        {
            FileName: "Landscape of Nice, France" + Date.now() + ".xml", // required
            Content: `<?xml version="1.0" encoding="UTF-8"?>
<asset>
   <image id="img457">
      <title>Landscape of Nice, France</title>
      <description>A beautiful photograph capturing the coastal landscape of Nice, France at sunset, with vibrant colors and natural lighting.</description>
      <creator>Hudson, Will</creator>
      <location>
         <city>Nice</city>
         <country>France</country>
         <coordinates>43.7034, 7.2663</coordinates>
      </location>
      <keywords>
         <keyword>landscape</keyword>
         <keyword>France</keyword>
         <keyword>Nice</keyword>
         <keyword>sunset</keyword>
         <keyword>coast</keyword>
         <keyword>nature</keyword>
         <keyword>travel</keyword>
      </keywords>
      <license>Royalty-Free</license>
      <rights>Editorial and Commercial Use</rights>
      <capture_date>2024-08-12</capture_date>
      <camera>
         <make>Canon</make>
         <model>EOS R5</model>
         <lens>RF24-105mm F4 L IS USM</lens>
      </camera>
   </image>
</asset>
            `, // required
            FolderId: "2Z0ZIFLPCPL8Y", // required
            ImportRetries: 3,
            ImportMinWaitBeforeRetry: 100,
            ImportMaxWaitBeforeRetry: 1000,
        },
        // Success callback function
        function (_sResp) {
        },
        // Failure callback function
        function (_sResp) {
        }
    );