I need details of invoice so i have written code like below,
But While getting response it is giving me an error.
*ERROR:*
Google.Ads.GoogleAds.V2.Errors.GoogleAdsException:
'Status(StatusCode=PermissionDenied, Detail="The caller does not have
permission")'
*CODE:*
string developerToken = "ZCtFpxQ5UQJWiVP6pQ8gNg";
string oAuth2clientId =
"335071599165-gs503ar3564tl5d2qjfq68ia3vg17uid.apps.googleusercontent.com";
string oAuth2Secret = "Y_fynHljTNNryhWlPsaIs5xl";
string oAuth2RefreshToken =
"1//04Sm-Jo4pYzbjCgYIARAAGAQSNwF-L9IraGHKFTj40I9kKBqjvw3-not0qzc7-mHqCVOyURjpiMgzPpfI9j1umb-lBT-W3ZtBWSQ";
long loginCustomerId = long.Parse("5614642714");
//long.Parse("1862082608");
GoogleAdsConfig googleAdsConfig = new GoogleAdsConfig()
{
DeveloperToken = developerToken,
LoginCustomerId = loginCustomerId.ToString(),
OAuth2ClientId = oAuth2clientId,
OAuth2ClientSecret = oAuth2Secret,
OAuth2RefreshToken = oAuth2RefreshToken,
};
GoogleAdsClient googleAdsClient = new
GoogleAdsClient(googleAdsConfig);
ListInvoicesRequest lstRequest = new ListInvoicesRequest();//
googleAdsClient.GetService(Services.V2.Li
session.GetService(Services.V2.CustomerService);
lstRequest.CustomerId = "5614642714"; //Acoount id for which
the invoices request
lstRequest.BillingSetup =
"customers/5614642714/billingSetups/264899716";
lstRequest.IssueYear = "2019";
lstRequest.IssueMonth =
GoogleAds.V2.Enums.MonthOfYearEnum.Types.MonthOfYear.December;
InvoiceServiceClient invService =
googleAdsClient.GetService(Services.V2.InvoiceService);
ListInvoicesResponse res = new ListInvoicesResponse();
res = invService.ListInvoices(lstRequest);
Please help
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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
"AdWords API and Google Ads 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/5e55e1f0-5a9b-4955-a43a-ac246cf548b1%40googlegroups.com.