本文介绍了Bing Ads Token会立即过期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个奇怪的问题,我希望有人可以帮助我。我正在尝试在PHP中集成Offline Conversions。我通过了OAuth令牌刷新,它正确地检索了一组新的令牌。

 $ authentication =(new OAuthDesktopMobileAuthCodeGrant())
- > withClientId ($ creds ['client_id'])
- > withRedirectUri('https://login.live.com/oauth20_desktop.srf');

$ this-> authorizationData =(new AuthorizationData())
- > withAuthentication($ authentication)
- > withAccountId($ creds ['account_id'])
- > withCustomerId($ creds ['customer_id'])
- > withDeveloperToken($ creds ['developer_token']);

$ client = new ServiceClient(
ServiceClientType :: CampaignManagementVersion11,
$ this-> authorizationData,
$ creds ['environment']
) ;

$ this-> authorizationData-> Authentication-> RequestOAuthTokensByRefreshToken($ creds ['refresh']);
$ client-> SetAuthorizationData($ this-> authorizationData); //以防万一,这应该没关系,我已经两种方式运行



我已检查过令牌是否已成功收到。我正在保存刷新令牌然后我打电话


  

$ response = $ client-> GetService() - > ApplyOfflineConversions($ request);


并收到此错误。

无效的客户数据。检查SOAP故障详细信息以获取更多信息

AdApiFaultDetail:{" TrackingId":" 337f096e-be37-4bfd-aefa-7eb5361f8a33"," Errors":{" AdApiError":{" ;代码":"" 109","Detail":null,"ErrorCode":"AuthenticationTokenExpired","Message":"验证令牌已过期。请续订或获取新令牌。"}}}

重试OAuth刷新令牌会出现同样的错误,有时会出现内部错误服务器错误。


我在这里做错了什么?这似乎应该可行。






< style type =" text / css"> p.p1 {margin: 0.0px 0.0px 0.0px 0.0px;字体:12.0px'Helvetica Neue';颜色:#454545} p.p2 {margin:0.0px 0.0px 0.0px 0.0px;字体:12.0px'Helvetica Neue';颜色:#454545; min-height:14.0px}< / style>

解决方案

中刷新令牌的年龄吗

Having a weird issue that I'm hoping someone can help me with. I'm trying to integrate Offline Conversions in PHP. I go through the OAuth token refresh, which retrieves a new set of tokens correctly.

$authentication = (new OAuthDesktopMobileAuthCodeGrant())
                ->withClientId($creds['client_id'])
                ->withRedirectUri( 'https://login.live.com/oauth20_desktop.srf');

$this->authorizationData = (new AuthorizationData())
            ->withAuthentication($authentication)
            ->withAccountId($creds['account_id'])
            ->withCustomerId($creds['customer_id'])
            ->withDeveloperToken( $creds['developer_token']);

$client = new ServiceClient(
    ServiceClientType::CampaignManagementVersion11,
    $this->authorizationData,
    $creds['environment']
);

$this->authorizationData->Authentication->RequestOAuthTokensByRefreshToken($creds['refresh']);
$client->SetAuthorizationData($this->authorizationData); //Just in case, this shouldn't matter, and I've run it both ways

I've checked that the tokens are being received successfully. I'm saving off the Refresh Token and then I call

$response = $client->GetService()->ApplyOfflineConversions($request);

and get this error.

Invalid client data. Check the SOAP fault details for more information

AdApiFaultDetail: {"TrackingId":"337f096e-be37-4bfd-aefa-7eb5361f8a33","Errors":{"AdApiError":{"Code":"109","Detail":null,"ErrorCode":"AuthenticationTokenExpired","Message":"Authentication token expired. Please renew it or obtain a new token."}}}

Retrying the OAuth refresh token gives the same error, or sometimes an Internal Server Error.

What am I doing wrong here? This seems like it should work.



<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545; min-height: 14.0px} </style>

解决方案



这篇关于Bing Ads Token会立即过期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 23:25