caller permission

27 views
Skip to first unread message

ofir sabag

unread,
May 6, 2024, 8:21:05 PM5/6/24
to Google Ads API and AdWords API Forum
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?

Google Ads API Forum Advisor

unread,
May 7, 2024, 4:54:57 AM5/7/24
to sabag...@gmail.com, adwor...@googlegroups.com
Hi,

I would kindly request you to check if you have a correct access level to the Google Ads account that you are accessing and share the screenshot with us for further investigation. 

To analyze this issue further could you please provide us with the below details.
  • Can you please run List Accessible Customers and provide us complete API request and response logs, you may also check this API documentation for more information.
  • The user email used for authenticating the API query. 
  • Also, I would suggest you to send the earlier requested complete API logs (request and response logs with request-id and request header) generated at your end. You can send the details via Reply privately to the author option, or direct private reply to this email.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02tPJ9x:ref" (ADR-00232555)

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages