HttpError 400 请求包含无效参数 Google API Campaign Manager - creatives().insert()

问题描述

我正在发送此正文。

cretive = {'name': 'test','advertiserId': '10229XXX','size': {'width': 320,'height': 50,'kind': 'dfareporting#size'},'type': 'disPLAY','creativeAssets': [{'assetIdentifier': {'kind': 'dfareporting#creativeAssetMetadata','assetIdentifier': {'type': 'IMAGE','name': '04132021-095558439-test.gif'},'id': '476784XXX','richMedia': False},'size': {'id': '12970','width': 320,'role': 'PRIMARY'}]}

通过这个调用

service.creatives().insert(profileId=profile_id,body=creative)

导致此错误的原因:

HttpError: https://dfareporting.googleapis.com/dfareporting/v3.4/userprofiles/6414XXX/creatives?alt=json 返回“请求包含无效参数。”。详细信息:“请求 包含无效参数。">

我使用的是 O-Auth2 并且没有任何身份验证问题。我已经双重/三次检查了正文中的所有参数是否符合 Google 的 documentation 要求,并且一直在遵循其 trafficking guides 中的所有步骤,除了缺少执行的这一步查询(已通过 Google 提交):

 # Upload the HTML5 asset
html5_asset_id = upload_creative_asset(service,profile_id,advertiser_id,html5_asset_name,path_to_html5_asset_file,'HTML')**.execute()**

# Upload the backup image asset
backup_image_asset_id = upload_creative_asset(
    service,backup_image_name,path_to_backup_image_file,'HTML_IMAGE')**.execute()**

谁能告诉我我遗漏或添加了哪些应该/不应该存在的论点?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)