creativeAssets.insert and creatives.insert

13 views
Skip to first unread message

Cédrick Patenaude

unread,
Mar 27, 2025, 11:01:59 AM3/27/25
to Google's Campaign Manager 360 API Forum
Hi,

I'm trying to insert a creative and upload assets (.zip) through the API with the javascript library. From what i unserstand, i have to upload assets first, and then use the returned response (id) to insert a creative. The best i got so far was a 200 ok response from the api but nothing else.

Here is my code. Anybody can help ? 

const formData = new FormData();
// Prepare metadata object
const metadata = {
kind: "dfareporting#creativeAssetMetadata",
assetIdentifier: { name: 'test.zip', type: 'HTML' }
};

// Append metadata as JSON string
formData.append('metadata', JSON.stringify(metadata), { contentType: 'application/json' });

// Ensure you're appending a readable stream of the zip file
const fileStream = fs.createReadStream(FILE_PATH);

// Append the file
formData.append('HTML', fileStream, {
filename: 'test.zip',
contentType: 'application/zip'
});

// Make the API request for uploading
const uploadRequest = dfareporting.creativeAssets.insert({
advertiserId: ADVERTISER_ID,
profileId: userProfile.profileId,
media: formData
});

DCM API (DoubleClick Campaign Mgr)

unread,
Mar 27, 2025, 5:13:50 PM3/27/25
to google-doubleclick-...@googlegroups.com

Hi,

Thank you for reaching out to the DCM API support team.

I understand you are trying to upload assets and create a creative using the JavaScript library, and you are receiving a 200 OK response but not seeing the creation created.

To help you with the creative creation process, here's some relevant information:

  • The CM360 API's "Creatives" resource allows for the retrieval of creative information, including creative IDs and associated metadata.
  • Specifically the creatives.get and creatives.list methods are useful in retrieving the specified data.
  • The "Creative Assets" resource allows for the management of the actual creative files. This resource majorly helps in inserting a new creative asset.
  • Specifically, the CreativeAssets.insert is useful in uploading the specified requests. 

Additionally, I would recommend you refer to this Upload your creative files help center article for more information.

To assist you further, could you please provide additional details to help us investigate the issue:

  • The DCM Account ID (found under your profile icon in the Campaign Manager 360 UI or in the Admin section).
  • The Profile ID used during the API request.
  • Request body and URL endpoint request with the path param values.
  • The complete API JSON request and response showing the issue/error.

You can send the details via Reply privately to the author option, or direct private reply to this email.
 


Thanks,
 
Google Logo DCM API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-03-27 21:13:41Z GMT] This message is in relation to case "ref:!00D1U01174p.!5004Q02vHDDH:ref" (ADR-00297003)



Reply all
Reply to author
Forward
0 new messages