如何在我的应用程序中使用其他用户的 refresh_token 用于 Google AdWords?
how to use refresh_token from another user on my app for the Google AdWords?
我有一个 Google AdWords 经理帐户来管理我们用户在我平台上的广告帐户。
用户需要给我 客户 ID(广告帐户) 如果他们想授权我。
当我使用 refresh_token 从连接我的 google 帐户。
但是,如果用户使用通过连接他们的 Google 帐户获得的 refresh_token,它将获得 USER_PERMISSION_DENIED
.
我的问题是
是否只有来自经理帐户的 refresh_token 可以通过 AdWords API 邀请某人?
那么,user/manager 中的 refresh_token 可以做什么?
node-adwords这是我用的库。
-------- 11/12 更新 --------
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)....
是的,只有经理帐户可以向其他想要管理的 AdWords 用户发送邀请。
这是与此问题相关的官方 google adwords doc。您需要阅读有关身份验证的部分(靠近页面底部)。有一张图表显示了 AdWords 帐户的管理层次结构。换句话说,您可以通过您的经理令牌对用户帐户进行操作(哪些帐户会受到影响取决于您在用户凭据 new AdwordsUser({clientCustomerId: 'xxxxxxxxxx'})
中指定的 adwords user id
)。
另外你不需要警惕的是:
+clientId.split('-').join('');
node-adwords
lib 或 adwords api 适用于 xxxxxxxxxx
和 xxx-xxx-xxxx
希望对大家有所帮助
我有一个 Google AdWords 经理帐户来管理我们用户在我平台上的广告帐户。
用户需要给我 客户 ID(广告帐户) 如果他们想授权我。
当我使用 refresh_token 从连接我的 google 帐户。
但是,如果用户使用通过连接他们的 Google 帐户获得的 refresh_token,它将获得
USER_PERMISSION_DENIED
.
我的问题是
是否只有来自经理帐户的 refresh_token 可以通过 AdWords API 邀请某人?
那么,user/manager 中的 refresh_token 可以做什么?
node-adwords这是我用的库。
-------- 11/12 更新 --------
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)....
是的,只有经理帐户可以向其他想要管理的 AdWords 用户发送邀请。
这是与此问题相关的官方 google adwords doc。您需要阅读有关身份验证的部分(靠近页面底部)。有一张图表显示了 AdWords 帐户的管理层次结构。换句话说,您可以通过您的经理令牌对用户帐户进行操作(哪些帐户会受到影响取决于您在用户凭据
new AdwordsUser({clientCustomerId: 'xxxxxxxxxx'})
中指定的adwords user id
)。
另外你不需要警惕的是:
+clientId.split('-').join('');
node-adwords
lib 或 adwords api 适用于 xxxxxxxxxx
和 xxx-xxx-xxxx
希望对大家有所帮助