Update from a third party
Update an asset with metadata from a third-party application. You can also use this utility to update an asset in Orange Logic by downloading an asset from a third-party application and uploading it as a new version of the existing Orange Logic asset.
UpdateFromThirdParty: function (_oOptions, _fCallbackSuccess, _fCallBackFail)
+ _oOptions.DownloadUrl:
+ _oOptions.RecordID:
+ _oOptions.LastExternalUploadNewVersionDate:
+ _oOptions.Headers:
+ _oOptions.SingleValueMetadata:
+ _oOptions.MultiValueMetadata:
+ _oOptions.ExternalID:
+ _oOptions.ExternalService:
+ _oOptions.SaveToFileName:
+ _oOptions.DownloadRetries:
+ _oOptions.DownloadMinWaitBeforeRetry:
+ _oOptions.DownloadMaxWaitBeforeRetry:
+ _oOptions.ImportRetries:
+ _oOptions.ImportMinWaitBeforeRetry:
+ _oOptions.ImportMaxWaitBeforeRetry:
Request parameter
This parameter is almost identical to the request parameter of the Import from a third party utility. The differences are:
- This parameter doesn’t use the
FolderID
orForcedSubType
attributes. - This parameter uses the following attributes:
Attribute | Type | Description | Required |
---|---|---|---|
RecordID | string | The record ID of an asset. | yes |
LastExternalUploadNewVersionDate | string | A date-time string that indicates the most recent upload of a new version in the third-party application. When a script including this utility runs, this timestamp is compared with the last upload time in Orange Logic. If the most recent upload to the third-party service is more recent than the last upload to Orange Logic, this utility will download the asset and upload it to Orange Logic as a new version of the Orange Logic asset. | yes |
Example
Utils.UpdateFromThirdParty(
{
DownloadUrl: `https://local.orangelogic.com/AssetLink/4ry6b3133j753w1a03nh3t8jpwspyx17.JPG`,
RecordID: '2Y8TWAFUPL3',
LastExternalUploadNewVersionDate: '2025-04-02T05:57:48Z',
Headers: {
'Authorization': `Bearer ABCXYZ123456`,
},
SingleValueMetadata: {
"CoreField.Title": "Imported through call external API",
"TestNameSpace.TestField": "Test value"
},
MultiValueMetadata: {
"CoreField.Keywords": ["Keyword1", "Keyword2"]
},
ExternalID: "External123",
ExternalService: "OrangeDAM",
SaveToFileName: `newfilename.jpg`,
},
// Success callback function
function (_sResp) {
Log.Warn('Executed sucessfully: ' + _sResp);
},
// Failure callback function
function (_sResp) {
Log.Warn('Execution failed: ' + _sResp);
}
);
Updated 13 days ago