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:
Attribute | Type | Description | Default value | Required |
---|---|---|---|---|
FileName | string | The title of the asset that will be created. ℹ️ Note IfImportContentFile 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. | undefined | yes |
FolderID | string | The record ID of the folder where the asset will be created. | undefined | yes |
Content | string | The text that will be the content of the new asset. | undefined | yes |
ImportRetries | number | The number of import retry attempts. | 3 | no |
ImportMinWaitBeforeRetry | number | The minimum number of minutes to wait before an import retry. | 100 | no |
ImportMaxWaitBeforeRetry | number | The maximum number of minutes to wait before an import retry. | 1000 | no |
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) {
}
);
Updated 13 days ago