0
votes

I have a Google AdWords manager account to manage our user's ads account in my platform.

The user needs to give me the customer id(ads account) if they want to authorize me.

  • I can invite any customer id for linked when I use the refresh_token which get from connecting my google account.

  • but, if the user uses the refresh_token which get from connecting their Google account, it will get USER_PERMISSION_DENIED.

my question is

is it only the refresh_token from manager account can invite someone by the AdWords API?

so, what the refresh_token from the user/manager can do?

node-adwords this is the library what I use.

-------- 11/12 updated --------

let user = new AdwordsUser({
  "client_id": "xxxxxxxxxxx.apps.googleusercontent.com",
  "client_secret": "xxxxxxxxxxx",
  "developerToken": "xxxxxxxxxx",
  "userAgent": "xxxx",
  "clientCustomerId": "mcc-account id",
  "debug": "true"
});

// linked customer.
user.credentials.refresh_token = 'refreshToken' (user's or mcc-account's?)

const managedCustomerService = user.getService('ManagedCustomerService', apiVersion);
const managerCustomerId = +user.credentials.clientCustomerId.split('-').join('');
const clientCustomerId = +clientId.split('-').join('');

const operation = {
  operator: 'ADD',
  operand: {
    managerCustomerId,
    clientCustomerId,
    linkStatus: 'PENDING',
    pendingDescriptiveName: 'invitation',
    isHidden: false,
  }
}

managedCustomerService.mutateLink({operations: [operation]}, (error, result)....
1
Show us the code how do you invite any customer id.Nastro
sure @Nastro. already updatedGiambi Huang

1 Answers

0
votes
  1. Yes, only manager account can send invitation to another adwords user who wants to be managed.

  2. This is official google adwords doc related to this question. You need to read section about Authentication (near to bottom of the page). There is a diagram which shows the management hierarchy of adwords accounts. In other words you can do operations with user account through your manager token (which accounts will be affected depends on what adwords user id specified in you user credentials new AdwordsUser({clientCustomerId: 'xxxxxxxxxx'})).

Also you do not need to wary about:

+clientId.split('-').join('');

node-adwords lib or adwords api works with both xxxxxxxxxx and xxx-xxx-xxxx

I hope it can help a bit.