Facebook Marketing API广告创意 [英] Facebook Marketing API ad creatives

查看:131
本文介绍了Facebook Marketing API广告创意的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Facebook应用程序具有批准的ads_readmanage_pages ads_managementbusiness_managementAds Management Standard Access权限.
我可以创建广告系列,广告集,并可以通过Facebook Marketing API将资产上传到Facebook.

I have the facebook application with approved ads_read, manage_pages ads_management, business_management and Ads Management Standard Access permissions.
I can create Ad campaign, ad set and can upload asset to Facebook via Facebook Marketing API.

但是当我尝试通过/adcreatives请求创建广告素材时,出现错误消息:

But when I try to create ad creative, with /adcreatives request, I get Error with message:

(#3)应用程序无法进行此API调用.

(#3) Application does not have the capability to make this API call.

curl请求的示例:

curl -X POST \
  'https://graph.facebook.com/v3.3/act_<account_id>/adcreatives?access_token=<access_token_here>' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Host: graph.facebook.com' \
  -d 'call_to_action_type=USE_APP&actor_id=<page_id>&object_type=APPLICATION&status=active&name=hello&title=foo&page_id=<page_id>&id=act_<account id>&image_hash=fb1a69e0965076e791183ac82c9f7417'

我尝试使用应用程序令牌,页面令牌和用户令牌(在FB业务管理器中允许)发出请求.
我也尝试过使用沙盒帐户,它是令牌
每个服务(应用程序,facebook页面和用户)都与业务经理中的业务帐户相关联,并具有管理员(最大)权限.

我尝试使用JSON请求在正文中发送数据,也尝试将其发送为x-www-form-urlencoded.
我尝试使用普通的HTTP请求,并尝试使用 facebook-nodejs-business-sdk
但是仍然没有成功.

I've tried making requests with app token, with page token and with user token (which was allowed in FB Business manager).
I've also tried with sandbox account and it's token
Every service (app, facebook page and user) connected with business account in business manager and have admin (max) permissions.

I've tried to send data in body with JSON request, I've tried to send data as x-www-form-urlencoded.
I've tried using plain http requests and tried with facebook-nodejs-business-sdk
But still no success.

因此,问题是,什么是正确的AD Creative创建请求,我的应用程序需要什么权限才能执行此类任务?

P.S.我还在Facebook Developers论坛上问了几个问题,但没有解决方案. q1 q3

So, the question is, what is the correct AD Creative create request and what permissions does my app need to perform such task?

P.S. I've also asked a few questions on Facebook Developers forum and got no solution. q1, q2, q3

推荐答案

我相信您的输入格式不正确(尽管从FB返回的错误通常从不表示太多).

I believe your input is malformed (although the returned errors from FB usually never indicate as much).

我看到的主要问题是广告素材信息没有通过object_story_spec参数传递.您正在制作的广告素材的类型以及必需的参数(在您的情况下为photo_data)将通过此对象传递.

The main issue that I see is that the creative information is not being passed through the object_story_spec parameter. The type of creative you are making is passed in through this object along with the necessary parameters, which would be photo_data in your case.

curl -X POST \
  'https://graph.facebook.com/v3.3/act_<ACT_ID>/adcreatives?access_token=<TOKEN>' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Host: graph.facebook.com' \
  -d 'link_url=<URL>&name=<CREATIVE_NAME>&object_type=PAGE&object_story_spec={page_id:<PAGE_ID>,photo_data:{image_hash:<HASH>,caption:<CAPTION>}}'

您可能需要根据需要添加或删除参数,但是以上请求对我有效.

You will probably need to add or remove parameters as needed, but the above request worked for me.

关于权限,这是我所拥有的:

In terms of permissions, here is what I had:

一些其他参考:
广告素材
对象故事规范
照片数据

Some additional references:
Ad Creative
Object Story Spec
Photo Data

这篇关于Facebook Marketing API广告创意的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆