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/listHowever, 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.