resolved. So, it turns out the fix is to NOT set the ClientEmail header. When this is set, it takes precedence over the overridden ClientID.
So, I've removed the line that assigned the ClientEmail header, and now when I assign the ClientID header, all is well. On Jun 26, 10:44 am, crozzer <cro...@justanswer.com> wrote: > Hi, > > I'm using awapi_dotnet_3.1.1. > > I think this is a bug, but want to ask the forum before reporting it. > > In the following code, I create a headers dictionary using the > web.config settings, then override the client ID, then create a user > and call getAccountInfo(), just like in Examples > \v13\AccountServiceNoConfigDemo.cs > > I would expect it to return the account info for the overridden Client > ID, but instead it returns the account info for the client id in the > web.config settings (which happens to be my MCC account). > > Any help much appreciated: > > ========== > Code-Behind: crosby-dev.aspx.cs > ========== > using System; > using System.Collections.Generic; > using System.Linq; > using System.Web; > using System.Web.UI; > using System.Web.UI.WebControls; > > using com.google.api.adwords.v13; > using com.google.api.adwords.lib; > using System.Text; > using com.google.api.adwords.lib.util; > > public partial class admin_crosby_dev : System.Web.UI.Page > { > > protected void Page_Load(object sender, EventArgs e) > { > Dictionary<string, string> headers = new Dictionary<string, string> > (); > headers.Add("email", ApplicationConfiguration.email); > headers.Add("password", ApplicationConfiguration.password); > headers.Add("useragent", "AWAPI DotNetLib " + > DataUtilities.GetVersion() + ApplicationConfiguration.companyName); > headers.Add("developerToken", > ApplicationConfiguration.developerToken); > headers.Add("applicationToken", > ApplicationConfiguration.applicationToken); > headers.Add("clientEmail", ApplicationConfiguration.clientEmail); > headers.Add("clientCustomerId", > ApplicationConfiguration.clientCustomerId); > > // The client ID I'm interested in: > headers["clientCustomerId"] = "938-333-7070"; > > AdWordsUser user = new AdWordsUser(headers); > AccountService service = (AccountService)user.GetService > (ApiServices.v13.AccountService); > > // call to the service that results in getting AccountInfo for the > MCC, instead of the Client ID specified: > AccountInfo acctInfo = service.getAccountInfo(); > > // Now format for Web Output > StringBuilder result = new StringBuilder(); > > result.AppendFormat("----- Account Info -----<br />Customer Id: {0} > <br />Descriptive Name: {1}<br />", > acctInfo.customerId, acctInfo.descriptiveName); > > if (null != acctInfo.billingAddress) > { > result.AppendFormat("Billing information<br /> Company Name: {0} > <br /> Address Line 1: {1}" + > "<br /> Address Line 2: {2}<br /> City: {3}<br /> > State: {4}<br /> Postal Code: {5}" + > "<br /> Country Code: {6}<br />", > acctInfo.billingAddress.companyName, > acctInfo.billingAddress.addressLine1, > acctInfo.billingAddress.addressLine2, > acctInfo.billingAddress.city, > acctInfo.billingAddress.state, > acctInfo.billingAddress.postalCode, > acctInfo.billingAddress.countryCode); > } > > result.AppendFormat("Time Zone ID: {0}<br />------------------------", > acctInfo.timeZoneId); > > Label1.Text = result.ToString(); > } > > } > > ========== > ASPX: crosby-dev.aspx > ========== > <%@ Page Language="C#" AutoEventWireup="true" CodeFile="crosby- > dev.aspx.cs" Inherits="admin_crosby_dev" %> > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > > <html xmlns="http://www.w3.org/1999/xhtml"> > <head runat="server"> > <title></title> > </head> > <body> > <form id="form1" runat="server"> > <div> > <asp:Label ID="Label1" runat="server" Text="Label"></ > asp:Label> > </div> > </form> > </body> > </html> > > ========== > Results in Unexpected Output: > ========== > > ----- Account Info ----- > Customer Id: 2900871247 > Descriptive Name: JustAnswer > Time Zone ID: America/New_York > ------------------------ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en -~----------~----~----~----~------~----~------~--~---