Hello ,
I am Getting  below error while getting campaign data .

*Error Description *
Google.Ads.GoogleAds.V16.Errors.GoogleAdsException: 
'Status(StatusCode="PermissionDenied", Detail="The caller does not have 
permission", DebugException="Grpc.Core.Internal.CoreErrorDetailException: 
{"created":"@1714284860.409000000","description":"Error received from peer 
ipv4:172.217.27.202:443","file":"..\..\..\src\core\lib\surface\call.cc","file_line":953,"grpc_message":"The
 
caller does not have permission","grpc_status":7}")'

*Code Snippet*

   string developerToken = .."XXXXX";
   string oAuth2clientId = "XXXXX";
   string oAuth2Secret = "XXX";
   string oAuth2RefreshToken = "XXXXX";
   long loginCustomerId = long.Parse("1111111");    -- *Tried with Manager 
Account ID and Customer ID*
   GoogleAdsConfig googleAdsConfig = new GoogleAdsConfig()
   {
       DeveloperToken = developerToken,
       LoginCustomerId = loginCustomerId.ToString(),
       OAuth2ClientId = oAuth2clientId,
       OAuth2ClientSecret = oAuth2Secret,
       OAuth2RefreshToken = oAuth2RefreshToken,
   };

   GoogleAdsClient googleAdsClient = new GoogleAdsClient(googleAdsConfig);
 GoogleAdsServiceClient googleAdsService = googleAdsClient.GetService(
   Services.V16.GoogleAdsService);

 string query = "SELECT campaign.id, campaign.name, campaign.status FROM 
campaign " +
     "ORDER BY campaign.id limit 100";

 List<string> campaigns = new List<string>();
 try
 {
     // Issue a search request.
     googleAdsService.SearchStream("{*CUSTOMER ID*}", query,
         delegate (SearchGoogleAdsStreamResponse resp)
         {
             foreach (GoogleAdsRow googleAdsRow in resp.Results)
             {
                 // Note: We don't use the default JSON converter, to enable
                 // better JSON rendering of enum values.
                
 //campaigns.Add(JsonFormatter.Default.Format(googleAdsRow.Campaign));
             }
         }
     );

     // return Content($"[{string.Join(",\n", campaigns)}]");
 }
 catch (Exception)
 {
     //return Problem(e.Message);
 }

Note: I have same email address for Ad Manager and Customer ID I have 
checked Access level as well not sure what is missing here can you please 
help on that.

Thank you

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/0ef6aa7c-baae-42d8-a4c4-b13a19b1a397n%40googlegroups.com.

Reply via email to