Bing Ads / PHP存在多个问题 [英] Multiple issues with Bing Ads / PHP

查看:71
本文介绍了Bing Ads / PHP存在多个问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首发

我正在查看以下文章: 

I am looking into following article: 

https:/ /msdn.microsoft.com/en-us/library/bing-ads-overview-getting-started-php-with-web-services(v = msads.100).aspx

https://msdn.microsoft.com/en-us/library/bing-ads-overview-getting-started-php-with-web-services(v=msads.100).aspx

在Linux Ubuntu 16.04上运行所有程序 - 安装所有库等。

Running everything on Linux Ubuntu 16.04 - all libraries are installed, etc.

在php5.6&上测试php7.0

Testing on both php5.6 & php7.0

首发V9& V10版本样本根本不适用于多个问题。 V11也有问题(例如文件包含最离奇的方式,到目前为止我已经看到了,但是......命名空间没有正确指定等等等等等等等等等等等等等等...

For a start V9 & V10 version samples simply don't work with multiple issues. V11 also have issues (for example files are included the most bizarre way, I've seen so far, but... Namespaces re not specified correctly and so on and so forth

示例:  PHP致命错误: 未捕获错误:未找到类'Microsoft \BingAds\v11 \CustomerManagement\Paging'在/var/www/html/dev.test00/bing2/BingAds-PHP-SDK/samples/V11/SearchUserAccounts.php:210

Sample: PHP Fatal error:  Uncaught Error: Class 'Microsoft\BingAds\v11\CustomerManagement\Paging' not found in /var/www/html/dev.test00/bing2/BingAds-PHP-SDK/samples/V11/SearchUserAccounts.php:210




因此,在解决了所有这些问题之后,我终于设法获得了有关我的沙盒帐户的一些细节 - 欢呼......但是 -   AuthenticateWithOAuth根本就没有不行。为什么? 
$


示例生成url以获取权限(我想):login.live.com/oauth20_authorize.srf?client_id=35d0bff1-56c9-4c73-b122 -42e80c457201& scope = bingads.manage& response_type = code& redirect_uri = https://login.live.com/oauth20_desktop.srf and ...当
我打开页面时我得到空错误页面WTF ???? ?
$


从这里采取的步骤:msdn.microsoft.com/en-us/library/bing-ads-php-walkthrough-desktop-application(v=msads。 100).aspx#oauth 



So after fixing all those issues I finally managed to get some details about my sandbox account - hurrah... But - AuthenticateWithOAuth simply doesn't work. Why? 

Sample generates url to get permissions (I suppose): login.live.com/oauth20_authorize.srf?client_id=35d0bff1-56c9-4c73-b122-42e80c457201&scope=bingads.manage&response_type=code&redirect_uri=https://login.live.com/oauth20_desktop.srf and... when I open page I get empty error page WTF?????

Steps taken from here: msdn.microsoft.com/en-us/library/bing-ads-php-walkthrough-desktop-application(v=msads.100).aspx#oauth 

推荐答案

只是为了确认repro步骤你是否通过composer安装了SDK?

Just to confirm repro steps have you installed the SDK via composer?

composer require microsoft/bingads

对于沙箱,您应该使用AuthenticateWithUserName,因为沙箱中不支持OAuth。这里有一些细节:  https://msdn.microsoft.com/en-us/library/bing-ads-php-walkthrough-desktop-application.aspx

For sandbox you should use AuthenticateWithUserName since OAuth is not supported in sandbox. There are some details here: https://msdn.microsoft.com/en-us/library/bing-ads-php-walkthrough-desktop-application.aspx

准备好之后制作和OAuth,该指南还提到了如何获得您的第一次访问和刷新令牌。 

Once you are ready for production and OAuth, the guide also mentions how to get your first access and refresh tokens. 

如果您有任何后续问题,请与我们联系。

Please let me know if you have any follow up questions.

致以最诚挚的问候,

Eric


这篇关于Bing Ads / PHP存在多个问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆