I am trying to access the google ads api with this code piece:
`public List<GoogleCampaign> GetCampaigns(string accountId)
{
SearchGoogleAdsStreamRequest search = new SearchGoogleAdsStreamRequest();
search.Query = @"SELECT
campaign.id,
campaign.name,
campaign.network_settings.target_content_network
FROM campaign
ORDER BY campaign.id";
search.CustomerId = accountId;
try
{
this.ServiceClient.SearchStream(search.CustomerId, search.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();
}`
but I am getting an error message saying “the caller does not have permission”
I have a valid refresh token as well as client id and client secret and I also made sure that the login_customer_id in the configuration is the manager account id
what are possible solutions for this error?
I tried to access several accounts under the same manager account, but the error remains the same for all of them. Therefore, I believe it is something related to the code rather than the account
the access level of the developer token I am using is testing and the client accounts I am trying to get data from are also testing accounts