Hi,
I am trying to upload a .zip or .adz file in order to add a creative asset in a creative.
The struggle is in using DoubleClickCampaigns.CreativeAssets.insert(resource, profileId, advertiserId, mediaData).
I always get the following error using that function:
9015 : You can only upload HTML5 assets in a .zip or .adz file. Reach out to the creative developer to resolve this issue by correcting the extension.
The code is as follows (all the variables are filled in properly):
var file = DriveApp.getFileById(fileId);
var mediaData = file.getBlob().setContentExtension("application/zip");
var resource = {
"kind": "dfareporting#creativeAssetMetadata",
"assetIdentifier": {
"type": "HTML",
"name": name
}
}
DoubleClickCampaigns.CreativeAssets.insert(resource, profileId, advertiserId, mediaData);
I also tried fetching a file with UrlFetchApp instead of getting it from Google Drive, but my preferred method is using Google Drive.
Thanks in advance!