Export to S3

Provide a record ID, format, and bucket information to synchronously export to an S3 bucket. This utility carries out the export action within the task the utility runs in, regardless of whether the Call external API automation is running synchronously or asynchronously.

ExportToS3: function (_sRecordID, _sFormat, _sRecipients, _oBucketInformation)
+ _oBucketInformation.BucketName:
+ _oBucketInformation.AWSRegion:
+ _oBucketInformation.Path:
+ _oBucketInformation.CredentialType:
+ _oBucketInformation.KMSEncryptionKeyID:
+ _oBucketInformation.CannedACL:
+ _oBucketInformation.AccessKeyID:
+ _oBucketInformation.SecretAccessKey:
+ _oBucketInformation.RoleARN:

This utility doesn’t use a success or failure callback attribute in the request parameter.

📘

Note

This utility is available beginning in Orange Logic Milan.

Request parameter attributes

AttributeTypeDescriptionRequired
RecordIDstringThe record ID of the asset to export.yes
Formatstring

The asset format to export.

ℹ️ Note Proxy formats are not generated when this utility runs. Therefore, this utility can only export existing proxy files. If necessary, use a separate call (such as the Generate or regenerate proxies call) to generate the proxy for export.
yes
RecipientsstringA comma-separated string of emails. A notification is sent to these addresses whenever this utility runs, notifying users of success or failure.yes
BucketInformationobjectDetails about the S3 bucket to export to.yes

The Bucket Information object uses the following string attributes:

AttributeDescriptionRequired
BucketNameAn AWS S3 bucket name.yes
AWSRegionAn AWS S3 region code.yes
PathAn AWS S3 bucket path.no
CredentialTypeAn AWS S3 credential type. Enter one of the following values:
  • IAMUser
  • STSDefault
  • Passthrough
yes
KMSEncryptionKeyIDAn AWS KMS encryption key.no
CannedACLAn AWS canned access control list grant. Enter one of the following values:
  • NoACL
  • private
  • public-read
  • public-read-write
  • authenticated-read
  • aws-exec-read
  • bucket-owner-read
  • bucket-owner-full-control
  • log-delivery-write
no
AccessKeyIDAn AWS IAM user access key ID.
Required only when the credential type is IAMUser.
no
SecretAccessKeyAn AWS IAM user secret access key.
Required only when the credential type is IAMUser.
no
RoleARNAn AWS IAM user role ARN.
Required only when the credential type is STSDefault.
no

Response parameter

Structure
{
  "Response": {
    "Results": [
      {
        "Success": true | false,
        "AmazonError": “Error code from AWS”,
        "ErrorMessage": “Internal error message”
      }
    ],
    "Message": "Schedule Export to S3 success for asset <recordid> and bucket <bucketname>”
  },
  "HTTPCode": -1,
  "Code": <SUCCESS | FAIL>
}
Example
var response = Utils.ExportToS3(
        // Record ID
        '2Y8V7CB92PR',
        // Format
        'TRX',
        // Email for receiving response email, separate by ,
        [],
        // Bucket information
        {
            BucketName: 'testBucket', // Required
            AWSRegion: 'ap-southeast-2', // Required
            Path: '2Y8V7CB92PR.mp4', // Required
            CredentialType: 'IAMUser', // Required. (IAMUser | STSDefault | Passthrough)
            AccessKeyID: '[Secrets.2Y8VTW5MLW9-AccessKeyID]',
            SecretAccessKey: '[Secrets.2Y8VTW5MDC8-SecretAccessKey]',
            KMSEncryptionKeyID: '',
            CannedACL: '',
        }
    );


Utils.ExecuteHttpRequest('https://webhook.site/48be8d47-2ee1-464b-9a34-2119cf3150e9',
    {
        Method: 'POST',
        Data:response
    },
    // Success callback function
    function (oHttp) {
        var oResult = JsonConvert.DeserializeObject(oHttp.responseText);
        Log.Info('Executed successfully: ' + oResult)
    },  
    // Failure callback function
    function (oHttp) {
        var oResult = JsonConvert.DeserializeObject(oHttp.responseText);
        Log.Warn('Execution failed: ' + oResult)
    }  
);
Example response
{
  "Response": {
    "Results": [
      {
        "Success": true,
        "AmazonError": "",
        "ErrorMessage": null
      }
    ],
    "Message": "Schedule Export to S3 success for asset <recordid> and bucket <bucketname>”
  },
  "HTTPCode": -1,
  "Code": "SUCCESS"
}