We've came across a challenge while integrating Adwords APIs 

While creating some code that is attempting to send conversion to Adwords 
in offline mode we've encountered the following exception:

AdsOAuthException
Failed to get access token for service account.
{
  "error" : "access_denied",
  "error_description" : "Requested scopes not allowed: 
https://adwords.google.com/api/adwords/";
}

Can you please help us to sort things out. Our code is running on our 
server without interactive mode, so we can't use authentication methods 
that requires user actions.

Below our developer posted his code:

                        String conversionName = signUp ? "PR_SignUP_IMP" : 
"PR_SignIN_IMP";

// Conversion time should be higher than the click time.
String conversionTime = "conversion time";
Double conversionValue = 50;

const int VIEWTHROUGH_LOOKBACK_WINDOW = 30;
const int CTC_LOOKBACK_WINDOW = 90;

Google.Api.Ads.AdWords.Lib.AdWordsUser user = new 
Google.Api.Ads.AdWords.Lib.AdWordsUser();
// Override specific configuration at runtime.
AdWordsAppConfig config = user.Config as AdWordsAppConfig;

config.ClientCustomerId = "790-315-2016";
config.DeveloperToken = "51zg7U9kpVxvKkptsujZwg";
config.UserAgent = "Proxy Rental User Managment";

config.AuthorizationMethod = AdWordsAuthorizationMethod.OAuth2;
config.OAuth2Mode = Google.Api.Ads.Common.Lib.OAuth2Flow.SERVICE_ACCOUNT;
config.OAuth2ServiceAccountEmail = "
107526653430-hu04rmqd3s16h2cklfaf2cpvjqlj1...@developer.gserviceaccount.com
";
config.OAuth2PrnEmail = "[email protected]";
config.OAuth2CertificatePath = 
@"c:\Production\ProxyRental\Node\8f3d2a5ae9a0bba176b18d2a207e38478500f9cb-privatekey.p12";
config.OAuth2CertificatePassword = "notasecret";

ConversionTrackerService conversionTrackerService = 
(ConversionTrackerService)user.GetService(AdWordsService.v201309.ConversionTrackerService);

// Create an upload conversion. Once created, this entry will be visible
// under Tools and Analysis->Conversion and will have "Source = Import".
UploadConversion uploadConversion = new UploadConversion();
uploadConversion.category = signUp ? ConversionTrackerCategory.SIGNUP : 
ConversionTrackerCategory.LEAD;
uploadConversion.name = conversionName;
uploadConversion.viewthroughLookbackWindow = VIEWTHROUGH_LOOKBACK_WINDOW;
uploadConversion.ctcLookbackWindow = CTC_LOOKBACK_WINDOW;

ConversionTrackerOperation uploadConversionOperation = new 
ConversionTrackerOperation();
uploadConversionOperation.@operator = Operator.ADD;
uploadConversionOperation.operand = uploadConversion;

ConversionTrackerReturnValue conversionTrackerRetval = 
conversionTrackerService.mutate(
    new ConversionTrackerOperation[] { uploadConversionOperation });

UploadConversion newUploadConversion = 
(UploadConversion)conversionTrackerRetval.value[0];

Console.WriteLine("New upload conversion type with name = '{0}' and id = 
{1} was created.",
    newUploadConversion.name, newUploadConversion.id);


Thank you for your help

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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