How to upload creative asset via REST API

484 views
Skip to first unread message

+NYCWMG Adopsbot

unread,
Jun 3, 2021, 1:02:05 PM6/3/21
to Google's Campaign Manager 360 API Forum
I'm trying to upload creative asset via REST API using postman, it throws error below:

{
"error": {
"code": 400,
"message": "Invalid JSON payload received. Unexpected token.\n PNG\r\n \n���\rIHDR��� �\n ^",
"errors": [
{
"message": "Invalid JSON payload received. Unexpected token.\n PNG\r\n \n���\rIHDR��� �\n ^",
"domain": "global",
"reason": "parseError"
}
],
"status": "INVALID_ARGUMENT"
}
}

In requestbody, I selected form_data and selected an image file
also set the assetIdentifier in the body 

{"type": "HTML_IMAGE","name": "google_logo.png"}

Can someone help please?Screen Shot 2021-06-04 at 1.01.21 AM.png

DCM API (DoubleClick Campaign Mgr)

unread,
Jun 4, 2021, 2:06:13 AM6/4/21
to nycwmg....@wmglobal.com, google-doubleclick-...@googlegroups.com

Hi there,

 

Thank you for reaching out to us with your concern.

 

I see that you are getting an error of 'Invalid JSON payload received'. Please ensure you are supplying correctly the fields of the request body in making this call. You can check out this docs for more info in creating creative assets.

Regards,

Google Logo
Michael Angelo Legaspi
DCM API Team
 


ref:_00D1U1174p._5004Q2HzzCb:ref

+NYCWMG Adopsbot

unread,
Jun 4, 2021, 2:31:00 AM6/4/21
to Google's Campaign Manager 360 API Forum
Hi,

I managed to somehow move on from the error above, now this error is what I am receiving:

{
  "error": {
    "code": 400,
    "message": "19023 : The dimensions of creative asset \"myimage.png\" are not valid.",
    "errors": [
      {
        "message": "19023 : The dimensions of creative asset \"myimage.png\" are not valid.",
        "domain": "global",
        "reason": "invalid"
      }
    ]
  }
}

Can't see any documentation about this error. Please help

DCM API (DoubleClick Campaign Mgr)

unread,
Jun 4, 2021, 5:30:24 AM6/4/21
to nycwmg....@wmglobal.com, google-doubleclick-...@googlegroups.com

Hi there,

 

Thank you for your response.

 

I'm glad that the issue on Invalid JSON payload has been resolved. With regards to your issue now, there are certain things to consider here:

  • If you add a regular image asset, the dimensions should match the asset
  • If you add a high-density image asset, the dimensions of the creative must match the aspect ratio of the image asset. The creative dimensions should match the dimensions of any assigned placements. For example, you can use a 600 x 500 asset in a 300 x 250 creative assigned to a 300 x 250 placement. 
  • If you add a single-size HTML5 asset, set the dimensions manually. The assets of your polite load and backup image assets should match the dimensions of the parent HTML5 asset. 
  • If you add a responsive or multi-size HTML5 asset, make sure all of the supported dimensions of the creative match all of the dimensions supported by the asset. You will need to add one backup image per dimension supported by the parent HTML5 asset. 

You can find this information and more about creative assets in the following docs:

If you have further questions regarding dimensions, you may contact our product-support team as they are more capable of handling this matter.

Regards,

Derrick Fulkerson

unread,
Jul 3, 2023, 1:51:14 PM7/3/23
to Google's Campaign Manager 360 API Forum
Hello, I know this is an old thread, but did you find a working solution using Postman?

DCM API (DoubleClick Campaign Mgr)

unread,
Jul 4, 2023, 10:07:18 AM7/4/23
to google-doubleclick-...@googlegroups.com

Hi Derrick,

Thank you for reaching out to us.

Please be informed that our support channel can only give precise guidance with regards to DCM API implementation and technical issues and we do not have the exact sample code for Postman. However, since postman is also in REST, I would suggest you check out this docs for more info in creating creative assets (https://developers.google.com/doubleclick-advertisers/rest/v4/creativeAssets/insert?apix_params=%7B%22profileId%22%3A6515134%2C%22advertiserId%22%3A6611446%2C%22resource%22%3A%7B%22kind%22%3A%22dfareporting%23creativeAssetMetadata%22%7D%7D#http-request) and to consider first all of the mentioned points below:

  • If you add a regular image asset, the dimensions should match the asset
  • If you add a high-density image asset, the dimensions of the creative must match the aspect ratio of the image asset. The creative dimensions should match the dimensions of any assigned placements. For example, you can use a 600 x 500 asset in a 300 x 250 creative assigned to a 300 x 250 placement. 
  • If you add a single-size HTML5 asset, set the dimensions manually. The assets of your polite load and backup image assets should match the dimensions of the parent HTML5 asset. 
  • If you add a responsive or multi-size HTML5 asset, make sure all of the supported dimensions of the creative match all of the dimensions supported by the asset. You will need to add one backup image per dimension supported by the parent HTML5 asset. 

You can find this information and more about creative assets in the following docs:

If you have further questions regarding dimensions, you may also contact our product-support (https://support.google.com/campaignmanager/answer/9026876?visit_id=637571474326282821-4077671228&rd=1) team as they are more capable of handling this matter.

This message is in relation to case "ref:_00D1U1174p._5004Q2HzzCb:ref"

Thanks,
 
Google Logo DCM API Team


Reply all
Reply to author
Forward
0 new messages