use*_*797 6 facebook facebook-ads-api facebook-sdk-4.0
随着新的Facebook广告API.如何找到与用户关联的所有广告帐户ID?
我看到有关如何获取有关帐户(给定ID)的详细信息的所有文档.但我找不到如何获取用户的广告帐户ID(通过api) https://developers.facebook.com/docs/marketing-api/adaccount/v2.3
请指教.
bje*_*ons 14
点击/ me/adaccounts路径以检索您的访问令牌(和应用)可以读取的帐户.
有关adaccounts边缘,请参阅用户Graph API文档的Edges部分:https://developers.facebook.com/docs/graph-api/reference/user
这对我有帮助,我希望有一天也能帮助别人。
这些是oAuth之后实现活动列表的步骤。
第 1 步(前端):
使用以下 URL 进行身份验证前端:
https://www.facebook.com/v3.0/dialog/oauth?client_id=<client_id>&redirect_uri=<URL>&scope=email%2Cads_management%2Cads_read&response_type=code&state=<state>
Run Code Online (Sandbox Code Playgroud)
步骤2(前端+后端):
Step 1将给出code对象,将其传递给后端
第三步(后端):
使用以下 API获取access-token用户
https://graph.facebook.com/v10.0/oauth/access_token?client_id=<client_id>&redirect_uri=<redirect_URL>&client_secret=<client_secret>&code=<code-from-front-end>
Run Code Online (Sandbox Code Playgroud)
第4步(后端):
获取广告帐户详细信息:
https://graph.facebook.com/v10.0/me/adaccounts?access_token=<access_token_from_step_3>
Run Code Online (Sandbox Code Playgroud)
第5步(后端):
获取营销活动列表:
https://graph.facebook.com/v10.0/act_<account_id_from_step_4>/campaigns?access_token=<access_token>&fields=id,name,objective,configured_status,effective_status,account_id,bid_amount,bid_strategy,start_time,end_time,targeting,daily_budget,campaign_id,special_ad_categories
Run Code Online (Sandbox Code Playgroud)
在这里您将获得授权用户的活动列表。
笔记:
Admin/Developer/Tester列表中添加了身份验证用户