.net Bing Ads API - 无效的客户数据 - 使用电子邮件地址 [英] .net Bing Ads API - Invalid Client Data - Using Email address

查看:78
本文介绍了.net Bing Ads API - 无效的客户数据 - 使用电子邮件地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 

我正在尝试使用以下代码连接到Bing Adwords api ...在V11中。

I am trying to connect to Bing Adwords api using following code...in V11.

PasswordAuthentication(用户名,密码);



$
                AuthorizationData authorizationData = new AuthorizationData

                {

                   身份验证=身份验证,

                    CustomerId = CustomerId,

                  DeveloperToken = DevToken 



                };
  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; Service = new ServiceClient< IReportingService>(authorizationData);



  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; CustomerService = new ServiceClient< ICustomerManagementService>(authorizationData);



  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; var user = await GetUserAsync(null);

PasswordAuthentication(UserName, Password);


                AuthorizationData authorizationData = new AuthorizationData
                {
                    Authentication = authentication,
                    CustomerId = CustomerId,
                  DeveloperToken = DevToken 

                };
                Service = new ServiceClient<IReportingService>(authorizationData);

                CustomerService = new ServiceClient<ICustomerManagementService>(authorizationData);

                var user = await GetUserAsync(null);

我在GetUserAsync收到错误 -   Microsoft.BingAds.V11.CustomerManagement.AdApiFaultDetail] :无效的客户端数据。检查SOAP故障详细信息以获取更多信息 

I am getting error at GetUserAsync - Microsoft.BingAds.V11.CustomerManagement.AdApiFaultDetail]: Invalid client data. Check the SOAP fault details for more information 

当我将userID作为用户名传递时它可以工作,但是当我将电子邮件ID作为用户名传递时不起作用。

It works when I pass the userID as username, but doesnt work when I pass the Email ID as a UserName.

现在,MS已停止创建用户ID。默认情况下,电子邮件ID被分配给用户ID。

Now on MS has stopped creating user ids. By default the email id is assigned to user ids.

不确定我哪里出错...还有其他方法可以通过这个电子邮件ID?

Not sure where I am going wrong... Is there any other way to pass the email id for this?

感谢您的支持

推荐答案

不再支持UserName和Password元素,因此也不支持PasswordAuthentication。从未支持通过UserName标头进行电子邮件身份验证。对于电子邮件身份验证,您需要通过OAuth并将
设置为AuthenticationToken标头元素。当您使用提供的类时,.NET SDK会自动设置标题,例如,

OAuthDesktopMobileAuthCodeGrant
。有关详细信息,请参阅身份验证指南

here

here

.NET桌面演练

The UserName and Password elements are no longer supported, and therefore PasswordAuthentication is also not supported. Email authentication via the UserName header has never been supported. For email authentication you'll need to go through OAuth and set the AuthenticationToken header element. The .NET SDK sets the header automatically when you use the provided classes e.g., OAuthDesktopMobileAuthCodeGrant. For more details see Authentication guides here and here, and the .NET Desktop Walkthrough.

我希望这有帮助!


这篇关于.net Bing Ads API - 无效的客户数据 - 使用电子邮件地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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