Error: User doesn't have permission to access customer. Note: If you're accessing a client customer, the manager's customer id must be set in the 'login-customer-id' header. See https://developers.google.com/google-ads/api/docs/concepts/call-structure#login-customer-id
at CustomerClientLinkService.<anonymous> (/home/gcieslik/workspace/export-creator-worker/node_modules/google-ads-api/build/services/service.js:178:23)
at Generator.throw (<anonymous>)
at rejected (/home/gcieslik/workspace/export-creator-worker/node_modules/google-ads-api/build/services/service.js:6:65)
code: { authorizationError: 2 },authorize() {
const client = new GoogleAdsApi({
client_id: this.clientId,
client_secret: this.clientSecret,
developer_token: this.developerToken
});
this.customer = client.Customer({
customer_account_id: this.customerAccountId,
login_customer_id: this.loginCustomerId,
refresh_token: this.refreshToken
});
}Hello,
Thank you for writing to us. If you are requesting OAuth credentials from a manager account and accessing a related customer account, you will need to set the login-customer-id header to the customer ID of the manager account, removing any hyphens in the Id and customer id in the request code. Could you please confirm if you are using the credentials associated with the login customer id to make API call? If yes, could you please share the email address used while generating Oauth credentials and the client customer id against which you are trying to make the API call for me to investigate this further on my end?
P.S. Please use Reply privately to author option while sharing the details for investigation.
Regards,
Nikisha Patel, Google Ads API Team