hey I'm trying to access the google ads api and manage data from manager account to his client accouts
I'm using this code
public List<GoogleCampaign> GetCampaigns(string accountId)
{
string query = @"SELECT
campaign.id,
campaign.name,
campaign.network_settings.target_content_network
FROM campaign
ORDER BY
campaign.id";
try
{
this.ServiceClient.SearchStream(accountId.ToString(), query, delegate (SearchGoogleAdsStreamResponse resp)
{
foreach (GoogleAdsRow googleAdsRow in resp.Results)
{
Console.WriteLine("Campaign with ID {0} and name '{1}' was found.",
googleAdsRow.Campaign.Id,
googleAdsRow.Campaign.Name);
}
});
}
catch (GoogleAdsException e)
{
Console.WriteLine("Failure:");
Console.WriteLine($"Message: {e.Message}");
Console.WriteLine($"Failure: {e.Failure}");
Console.WriteLine($"Request ID: {e.RequestId}");
throw;
}
throw new NotImplementedException();
}
with this configuration template
DeveloperToken = @"***",
OAuth2Mode = Google.Ads.Gax.Config.OAuth2Flow.APPLICATION,
OAuth2ClientId = "***.
apps.googleusercontent.com",
OAuth2ClientSecret = "***",
OAuth2RefreshToken = "***",
LoginCustomerId = "***"
I do have valid client id client secret developer token and a refresh token
the developer token access level is testing
the client accounts I'm trying to access are also testing level
but when I run the code I get an error message saying "the caller does not have permission"
what can I do to fix this?