【发布时间】:2018-03-09 13:49:38
【问题描述】:
当我使用此代码时:
<?php
require_once "vendor/autoload.php";
$config = ...;
use FacebookAds\Api;
use FacebookAds\Object\Page;
Api::init(
$config['facebook']['app_id'], //APP_ID
$config['facebook']['app_secret'], //APP SECRET
$config['facebook']['app_access_token'] //Token generated by https://developers.facebook.com/tools/explorer for app
);
$page = new Page($config['facebook']['page_id']);
$leadgen_forms = $page->getLeadgenForms(); //heres an error
我得到错误:
Fatal error: Uncaught FacebookAds\Http\Exception\AuthorizationException: (#190) This method must be called with a Page Access Token in ...
但是当我将 page_access_token 代替 app_access_token(来自https://developers.facebook.com/tools/explorer)时,我得到错误:Uncaught FacebookAds\Http\Exception\AuthorizationException: Invalid appsecret_proof provided in the API argument in ...。当我删除行时:
【问题讨论】:
-
向我们展示您在哪里/如何“使用 page_access_token 代替 app_access_token”
-
@CBroe,我只是从资源管理器复制并粘贴到配置中代替 app_access_token;