I have a problem running the Google Ads example.
using Google.Ads.GoogleAds.Lib;
using Google.Ads.GoogleAds.Config;
using Google.Ads.GoogleAds.V2.Errors;
using Google.Ads.GoogleAds.V2.Services;
using System;
namespace Google.Ads.GoogleAds.Examples.V2
{
public class ListAccessibleCustomers
{
public static void Main(string[] args)
{
ListAccessibleCustomers codeExample = new ListAccessibleCustomers();
GoogleAdsConfig config = new GoogleAdsConfig()
{
LoginCustomerId = "ХХХ-ХХХ-ХХХХ",
DeveloperToken = "ХХХХХ",
OAuth2ClientId = "ХХХХХ.apps.googleusercontent.com",
OAuth2ClientSecret = "ХХХХХХ",
OAuth2RefreshToken = "ХХХХХХ"
};
GoogleAdsClient client = new GoogleAdsClient(config);
codeExample.Run(client);
Console.Read();
}
public void Run(GoogleAdsClient client)
{
CustomerServiceClient customerService = client.GetService(Services.V2.CustomerService);
try
{
string[] customerResourceNames = customerService.ListAccessibleCustomers();
foreach (string customerResourceName in customerResourceNames)
{
Console.WriteLine($"Found customer with resource name = '{customerResourceName}'.");
}
}
catch (GoogleAdsException e)
{
Console.WriteLine("Failure:");
Console.WriteLine($"Message: {e.Message}");
Console.WriteLine($"Failure: {e.Failure}");
Console.WriteLine($"Request ID: {e.RequestId}");
}
}
}
}