Hi,

You are setting the values on the *config* *after* you call the AdWordsUser 
constructor. Since the values from the config are set in the AdWordsUser's 
base class constructor 
<https://github.com/googleads/googleads-dotnet-lib/blob/master/src/Common/Lib/AdsUser.cs#L102>,
 your 
changes to the config after the constructor call will have no effect on the 
AdWordsUser object.

Any one of the following would fix this issue:

   1. Modify the config *before* creating your AdWordsUser
   2. Set the ClientCustomerId in your config XML to the correct customer ID
   3. Set the clientCustomerId on the request header directly via: 
campaignService.RequestHeader.clientCustomerId 
   = "449-909-2808"

Please give one of those a try and let me know if you still run into 
problems.

Cheers,
Josh, AdWords API Team

On Wednesday, July 23, 2014 6:38:40 AM UTC-4, Chad Ruff wrote:
>
> Hi ,
>
> 1. I had  logged into my  MCC account  account when i  generated the 
> refresh token in my config.
> 2. The  client customer ID that i am using in my code snippet below is for 
> an AdWords account
>  
>  * config.ClientCustomerId = "449-909-2808".ToString().Replace("-", "")*
>
> Thanks and Regards
>
>
>
> On Tuesday, July 22, 2014 4:32:46 PM UTC+5:30, Chad Ruff wrote:
>>
>> Hi ,
>>
>> I have adwords google api asp.net code 
>> sample googleads-dotnet-lib-master.zip
>>
>> I have also generated the OAuth2RefreshToken using the 
>> OAuthTokenGenerator project
>>
>> i have made changes to the app.config file 
>>  <add key="UserAgent" value="GoogleAdwordsTest"/>
>>  <add key="DeveloperToken" value="DeveloperToken"/>
>>   <add key="ClientCustomerId" value="123-456-7890"/>
>>   <add key="AuthorizationMethod" value="OAuth2" />
>>   <add key="Email" value="[email protected]"/>
>>   <add key="Password" value="Password"/>
>>   <add key="OAuth2ClientId" value="
>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com" />
>>  <add key="OAuth2ClientSecret" value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
>>  <add key="OAuth2Mode" value="APPLICATION" />
>>
>> i am running the Google.Api.Adwords.Examples.VB.v201406.GetCampaigns 
>> sample from 
>>
>> Adwords.Examples.VB Project v201406-->BasicOperations--> GetCampaigns.vb 
>> class
>>
>> i have just added these two lines
>>
>>   Public Sub Run(ByVal user As AdWordsUser)
>>       ' Get the CampaignService.
>>       Dim campaignService As CampaignService = user.GetService( _
>>           AdWordsService.v201406.CampaignService)
>>
>>           *  Dim config As AdWordsAppConfig = DirectCast(user.Config, 
>> AdWordsAppConfig)*
>> *            config.ClientCustomerId = 
>> "987-654-4321".ToString().Replace("-", "")*
>> *            config.DeveloperToken = "DeveloperToken"*
>>
>>       Dim selector As New Selector
>>       selector.fields = New String() {"Id", "Name", "Status"}
>>
>>       ' Set the selector paging.
>>       selector.paging = New Paging
>>
>>       Dim offset As Integer = 0
>>       Dim pageSize As Integer = 500
>>
>>       Dim page As New CampaignPage
>>
>>       Try
>>         Do
>>           selector.paging.startIndex = offset
>>           selector.paging.numberResults = pageSize
>>
>>           ' Get the campaigns.
>>           page = campaignService.get(selector)
>>
>> *I am getting  this error [AuthorizationError.USER_PERMISSION_DENIED @ ; 
>> trigger:'<null>'] on the above line*
>>
>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to