Upload creative file via API

416 views
Skip to first unread message

Jose Cobo Rivas

unread,
Apr 29, 2022, 9:03:39 AM4/29/22
to Google's Campaign Manager 360 API Forum
Hello, sorry for my English but I'm from Uruguay, I'm using the google.dfareporting client library in node js and I'm not sure how to upload a creative file to Campaign manager 360. From what I understood, you have to upload the creative file with the creativeAssets.insert method, and then a creative with the creatives.inser method. Could you please show me an example of how to upload a creative file with the google.dfareporting library. I have already reviewed this forum and all the documentation several times but I can't find any example in node js. I would really appreciate it.

DCM API (DoubleClick Campaign Mgr)

unread,
May 4, 2022, 3:04:19 AM5/4/22
to jose...@wundermanthompson.com, google-doubleclick-...@googlegroups.com

Hello Jose,

 

Michael here from DCM API Team. Thank you for reaching out to us.

 

We do have documentation guide on how you can upload media files through API request calls, kindly check here. However, please be informed that we can only respond precisely with regards to use of API or API responses issues. We do have sample client libraries here written in node js that you may use as a reference. However, should the client library not suffice to your use case, we would recommend reaching out directly to the developer's support specialist team as they are the one who maintains our client library and would be more capable of providing a sample in node js that would achieve your use case.

Regards,

Google Logo
Michael Angelo
DCM API Team
 


ref:_00D1U1174p._5004Q2aOqFy:ref

Simon Vintrob

unread,
Dec 12, 2022, 9:59:06 AM12/12/22
to Google's Campaign Manager 360 API Forum
Hey, having the same error here. Docs are incomplete and so is sample code. Any help would be greatly appreciated. Thanks! 

Simon Vintrob

unread,
Dec 12, 2022, 3:09:35 PM12/12/22
to Google's Campaign Manager 360 API Forum
Got it to work.
You basically need to send a stream:
let bufferStream = new Stream.PassThrough();
bufferStream.end(/* buffer data goes here */);

let body = {
advertiserId: global_options.advertiser_id,
profileId: global_options.profile_id,
requestBody: {
media: {
mimeType: mimetype,
body: bufferStream,
},
}

DCM API (DoubleClick Campaign Mgr)

unread,
Dec 13, 2022, 12:18:00 AM12/13/22
to simon....@beyondmediaagency.com, google-doubleclick-...@googlegroups.com

Hello Simon,

 

Michael here from DCM API support team. Thank you for reaching out to us. We appreciate you sharing your inputs as this will help our community should they encounter similar concerns. Looks like the issue has been resolved here, is that correct? Nonetheless, let us know should you have further questions yourself so we can assist you.

 

Regards,

Google Logo
Michael Angelo
DCM API Team
 


ref:_00D1U1174p._5004Q2h21eS:ref

Michael Barsotti

unread,
Jan 4, 2023, 5:33:57 PM1/4/23
to Google's Campaign Manager 360 API Forum
I'm too stupid to know what to make of your response, would you happen to know if there is a working example, tutorial, or anything that will walk me through this step by step?

DCM API (DoubleClick Campaign Mgr)

unread,
Jan 4, 2023, 11:45:38 PM1/4/23
to michael.barso...@gmail.com, google-doubleclick-...@googlegroups.com

Hello Michael,

 

Thank you for reaching out.

 

Were you trying to upload creative asset as well? If so, we do have documentation guide on how you can Upload Media files through API request calls. Then, you may use the creatives.insert method to create a new creative. We also have samples and libraries for you to use as reference and help you in your implementation. If this does not suffice to your use case, kindly elaborate and give full context of what you are trying to do so we can better assist you.

Regards,

Google Logo
Michael Angelo
DCM API Team
 


ref:_00D1U1174p._5004Q2hZmGP:ref

Simon Vintrob

unread,
Jan 5, 2023, 12:18:35 PM1/5/23
to Google's Campaign Manager 360 API Forum
Hi Michael. I couldn't find a comprehensive tutorial online; I recommend following the schema in https://developers.google.com/doubleclick-advertisers/rest/v3.4/creativeAssets/insert
My post above explains the parameters to pass to the function (if using JS client) or api call.
Good luck!

Message has been deleted

Michael Barsotti

unread,
Jan 5, 2023, 3:38:59 PM1/5/23
to Google's Campaign Manager 360 API Forum
Well, baby steps. I'm getting this error and don't know what to do
{
  "error": {
    "code": 400,
    "message": "19020 : The image type of file \"\" is not supported.",
    "errors": [
      {
        "message": "19020 : The image type of file \"\" is not supported.",
        "domain": "global",
        "reason": "invalid"
      },
      {
        "message": "19017 : The name of the file can only contain the following characters: A-Z a-z 0-9 . = - _",
        "domain": "global",
        "reason": "invalid"
      },
      {
        "message": "19004 : Invalid file name specified.",
        "domain": "global",
        "reason": "invalid"
      }
    ]
  }
}

On Thursday, January 5, 2023 at 11:19:52 AM UTC-6 Michael Barsotti wrote:
I have poured over these documents trying to get this to work with nodejs and can't seem to follow these documents. I was hoping to find a working example uploading assets to Campaign Manager.

DCM API (DoubleClick Campaign Mgr)

unread,
Jan 5, 2023, 11:50:36 PM1/5/23
to michael.barso...@gmail.com, google-doubleclick-...@googlegroups.com

Hello Michael,

 

Can you confirm if you have checked out our node js sample in samples and libraries? Additionally, we also recommend that you checked out the creativeAssets.insert method shared also by Simon.

 

With regards to the errors you encountered, kindly ensure that the image type of asset being uploaded is supported and the name of it does not have special characters other than A-Z a-z 0-9 . = - _",

 

For us to investigate further on that, kindly provide the below information to us privately via "Reply To Author" button.

  • DCM Account ID
  • Profile ID used in request call
  • Request body & URL with path param values
  • Complete API Response from the above request (I know this has been shared, just in case you will share a different request call)

 

As a side note, thank you Simon for being active in helping in our community forum.

Michael Barsotti

unread,
Jan 6, 2023, 10:07:50 AM1/6/23
to Google's Campaign Manager 360 API Forum
First of all, thank you both for helping me with this.
I have been over every document everyone here has linked to, multiple times. I'm going to write up what I'm doing with as much detail is reasonable and "replay to author", it might take a while for me to put that together (I work on this between client work)

DCM API (DoubleClick Campaign Mgr)

unread,
Jan 9, 2023, 5:14:30 AM1/9/23
to michael.barso...@gmail.com, google-doubleclick-...@googlegroups.com

Hello Michael,

 

Confirming that we have received your private reply to us. Would you be able to try to change the 'Content-Type':"image/png" to Content-Type: image/jpeg as shown in this example of simple upload? We would also suggest to try a simple file name with no special characters just to narrow down the issue.

 

Kindly try the above and let us know how it goes. We will raise this to our wider team as necessary when you came back with no success on your end.

Regards,

Derrick Fulkerson

unread,
Jul 3, 2023, 1:28:19 PM7/3/23
to Google's Campaign Manager 360 API Forum
Hello, were you able to find a working solution? I am seeing some of the same errors messages you are and have poured over the documentation and am unsure what I am doing wrong. I'd like to see a succinct example using an HTTP connector or Postman, but I have yet to find one.

DCM API (DoubleClick Campaign Mgr)

unread,
Jul 4, 2023, 8:53:58 AM7/4/23
to google-doubleclick-...@googlegroups.com

Hi Derrick,

Thank you for reaching out to us.

Could you confirm if you are indeed having the exact errors encountered by Michael? If yes, below is a workable curl request that our team tested: 

"""
curl -H "X-Goog-Upload-Protocol: multipart" -H "multipart/related" -F"metadata=@/usr/local/google/home/test/Desktop/data/upload.txt;type=application/json" -F "image=@/usr/local/google/home/test/Desktop/testAsset.jpeg;type=image/jpeg" https://test.com:0000/upload/dfareporting/v4/userprofiles/000000/creativeAssets/000000/creativeAssets

"""

test:data$ cat upload.txt

{

 "assetIdentifier": {

  "name": "testAsset.jpeg",

  "type": "HTML_IMAGE"

 }

}

You may try on your end if it will work for you. Just know that I have replaced some of the private information to test and other details as well as domain name, account id, profile id and asset id for privacy purposes. You may change that accordingly as necessary.

However, if it still does not work for you. We would highly recommend reaching out to developers specialist support (https://github.com/google/google-api-objectivec-client-for-rest/issues) team as they better equipped to provide guidance on this matter.

However, if you are not encountering the same exact error Michael encountered, could you confirm if you already checked out the creativeAssets.insert (https://developers.google.com/doubleclick-advertisers/rest/v4/creativeAssets/insert) method and the documentation guide on how you can Upload Media (https://developers.google.com/doubleclick-advertisers/upload?hl=en) files through API request calls and use the creatives.insert (https://developers.google.com/doubleclick-advertisers/rest/v4/creatives/insert?hl=en) method to create a new creative? If not, I would suggest you consider it first.

Additionally, kindly ensure that the image type of the asset being uploaded is supported and that the name of it does not have special characters other than A-Z a-z 0–9. = - _",

However, for us to investigate further the error you are encountering, kindly provide the below information to us privately via the "Reply To Author" button.

  • DCM Account ID
  • Profile ID used in the request call
  • Request body and URL with path param values
  • Complete API Response from the above request (I know this has been shared, just in case you will share a different request call).
 
This message is in relation to case "ref:_00D1U1174p._5004Q2hZmGP:ref"

Thanks,
 
Google Logo DCM API Team


Reply all
Reply to author
Forward
0 new messages