hello.

I am thinking of downloading my monthly invoices by "invoices" in Google 
Apds API.
https://developers.google.com/google-ads/api/rest/reference/rest/v10/customers.invoices/list

However, when I run it, I get an error "PERMISSION_DENIED".
If there is no record specified, it should return that error, but if it is 
an authorization error, I am having trouble figuring out what to allow.

I am running it in Google AppScript (GAS), but I am not sure what I am 
missing or what permissions I should allow.

Please let me know if there is anything I am missing or if I have any 
permissions:
=============================================
  const billingSetup = 
`customers/${customerId}/billingSetups/${billing_Setup}`;
  const url = 
`https://googleads.googleapis.com/v10/customers/${customerId}/invoices?billingSetup=${billingSetup}&issueYear=${issueYear}&issueMonth=${issueMonth}`;
  const headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer " + access_token,
    "developer-token": developer_token,
    "login-customer-id": mcc_account
  };
  Logger.log(headers);
  Logger.log("url : " + url);
  const options = {
    "method": "get",
    "headers": headers,
  };
  const httpResponse = UrlFetchApp.fetch(url, options);
  const status = httpResponse.getResponseCode();
  if (status ! == 200) {
    throw "HttpRequestError";
  }
  const response = JSON.parse(httpResponse.getContentText());
=============================================

error:
=============================================
    
Exception: Request failed for https://googleads.googleapis.com returned 
code 403. Truncated server response: {
  "error": {
    "code": 403,
    message": "The caller does not have permission",
    "status": "PERMISSION_DENIED",
    "details": [
      {
 ... (use muteHttpExceptions option to examine full response)
=============================================

Thank you for your cooperation.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/58056c83-2fa3-469b-b696-603942083c55n%40googlegroups.com.

Reply via email to