我有Facebook应用程序 . 用户的用户ID和访问令牌已授予ads_management和ads_read权限 . 如何获取与该用户相关联的所有广告帐户的列表?
很高兴看到php中的解决方案 . 谢谢!
使用 /adaccounts endpoints .
/adaccounts
如果你使用的是php SDK,那就行了 . 我在这里使用 me 作为ID . 您可以将其更改为您管理广告的用户的帐户ID .
me
$request = new FacebookRequest( $session, 'GET', '/me/adaccounts' ); $response = $request->execute(); $graphObject = $response->getGraphObject(); /* handle the result */
否则,将此CURL请求移植到PHP:
curl -i -X GET \ "https://graph.facebook.com/v2.7/me/adaccounts?access_token="<ACCESS_TOKEN>"
我建议使用图表API Explorer进行实验,如果你还没有 .
1 回答
使用
/adaccounts
endpoints .如果你使用的是php SDK,那就行了 . 我在这里使用
me
作为ID . 您可以将其更改为您管理广告的用户的帐户ID .否则,将此CURL请求移植到PHP:
我建议使用图表API Explorer进行实验,如果你还没有 .