googleapis / google-api-nodejs-client

Google's officially supported Node.js client library for accessing Google APIs. Support for authorization and authentication with OAuth 2.0, API Keys and JWT (Service Tokens) is included.
https://googleapis.dev/nodejs/googleapis/latest/
Apache License 2.0
11.41k stars 1.92k forks source link

Uploading ZIP throws error ASSET_HTML_CLICK_TAG_MISSING #3517

Closed Larslol140 closed 3 months ago

Larslol140 commented 3 months ago

Environment details

Steps to reproduce

  1. Create an zip archive with a HTML file.
  2. Use createReadStream to open the file.
  3. Use advertisers.assets.upload to upload the file.

Additional info

This also occurs when using the sample.zip from https://support.google.com/displayvideo/answer/7128959?hl=en#zippy=%2Ccreate-an-html-display-banner

Uploading the same ZIP file manually works.

When uploading via the library it results in: Error: ASSET_HTML_CLICK_TAG_MISSING: Must include at least one click tag in the HTML asset.

Sample snippet

const stream = createReadStream("example.zip");

dv360.advertisers.assets.upload({
        advertiserId: "advertiser-id",
        requestBody: {
          filename: "example.zip",
        },
        media: {
          body: stream,
          mimeType: "application/zip",
        },
      });
Larslol140 commented 3 months ago

I was missing the name attribute in the creative exitEvents. When I added it with the value clickTag it worked.