本文介绍了使用Ads API上传image_file的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我正在尝试为活动广告(迁移后)创建新的广告素材,使用字段 image_file 。I'm trying to create a new Ad Creative for an event ad (Post-Migration), using the field image_file.通过 Graph API资源管理器发送以下发布请求:Via the Graph API Explorer I send the following post request:我收到以下异常响应:显然我没有使用image_file参数。我应该如何使用它?Apparently I'm not using the image_file parameter right. How should I use it?推荐答案只尝试上传图片,而不是使用图像哈希来上传广告素材。Try uploading image only, and than use image hash to upload creative.参数:[ IMAGE_NAME => '@' + path]POST https://graph.facebook.com//act_xxxx/adimages IMAGE_NAME的名字带有extension-image.jpg或image.png ...IMAGE_NAME is name with extension - image.jpg, or image.png...作为回复,您将获得[ 'images' => [ [ 'hash' => ..., 'url' => .... ] ]]您收到的图像哈希值并创建广告素材。Than use the image hash you received and create ad creative with that.如果您只想执行一个请求,请执行下一步:If you want to do only one request, do next:curl \-F 'access_token=...' \-F 'title=Test title' \-F 'body=Test body' \-F 'link_url=http://www.whatever.com' \-F 'name=test creative' \-F 'image_file=Art.jpg' \-F 'Art.jpg=@C:\Art.jpg ' \'https://graph.facebook.com/act_xxxx/adcreatives' 这篇关于使用Ads API上传image_file的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-28 15:18