python - Facebook 从 image_hash 获取 AdImage url
问题描述
我的代码(python-business-sdk):
account = AdAccount(ad_account_id)
img = account.get_ad_images(params={'hashes': ['6b709f0275d0bdf18fb78ef08492ee79'})[0]
print(img['url']) # doesnt work
primt(img[AdImage.Field.url]) # doesnt work
我做了请求,但在我的img
var(AdImage obj)中只得到了 id 和 hash:
'{..., _json': {'hash': '6b709f0275d0bdf18fb78ef08492ee79', 'id': '36246837:6b709f0275d0bdf18fb78ef08492ee79'}}}
但我需要图像的 url,这里是带有字段的文档(url
在那里),但我没有收到这些或不知道如何获取..
https://developers.facebook.com/docs/marketing-api/参考/广告图像#examples_read
解决方案
只需将 fields 参数添加到 get_ad_images
推荐阅读
- jquery - 使用 Laravel 中控制器的 JSON 响应自定义错误
- c++ - 制作一个小于十的不同随机整数的列表
- android - 如何解决android studio 3.4以上版本中的清单合并文件?
- sql - 如何将变量连接到postgresql中的其他变量?
- c++ - 是否需要互斥锁才能将参数传递给 pthread?
- python - 以模式排序列表
- sql - 蜂巢查询以查找客户从当前交易日期起过去 10 天内的交易总数
- javascript - Vue路由器缺少参数
- python - 根据均值、标准差和偏度创建新的 pdf
- java - 即使请求正文中存在错误,BindingResult 也不会显示错误