首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >DEVELOPER_TOKEN_NOT_APPROVED by Google Ads API for PHP

DEVELOPER_TOKEN_NOT_APPROVED by Google Ads API for PHP
EN

Stack Overflow用户
提问于 2020-08-05 13:55:37
回答 1查看 446关注 0票数 0

我想使用Google Ads访问Google Ads报告。作为第一步,我们希望使用GoogleCustomerServiceClient来检索客户信息。

代码语言:javascript
复制
$MMC_ID = <My MMC 10 digits number>;

$credentialsIniPath = app_path('resources/credentials/google/google_ads_php.ini');

$oAuth2Credential = (new OAuth2TokenBuilder())
    ->fromFile($credentialsIniPath)
    ->build();

$googleAdsClient = (new GoogleAdsClientBuilder())
    ->fromFile($credentialsIniPath)
    ->withOAuth2Credential($oAuth2Credential)
    ->build();

$customerServiceClient = $googleAdsClient->getCustomerServiceClient();

try {
    $customer = $customerServiceClient->getCustomer(ResourceNames::forCustomer($MMC_ID));
} catch(GoogleAdsException $e) {
    $this->error($e->getMessage());
}

但是它会返回一个错误

代码语言:javascript
复制
Fault
-------
Status code: 7
Details: The caller does not have permission
Failure: {"errors":[{"errorCode":{"authorizationError":"DEVELOPER_TOKEN_NOT_APPROVED"},"message":"The developer token is not approved. Non-approved developer tokens can only be used with test accounts."}]}

创建MMC的帐户Oauth2登录是测试帐户。在google_ads_php.ini中,已经填写了clientId、clientSecret、refreshToken和developerToken。刚刚生成了refreshToken

我应该在这里面检查什么呢?

谢谢。

EN

回答 1

Stack Overflow用户

发布于 2020-08-05 14:44:29

我从这个URL创建了一个新的URL,用于测试。https://adwords.google.com/um/Welcome/?sf=mt

已解决。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63259201

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档