要將現有帳戶鏈接到您的MCC帳戶,您還需要使用ManagedCustomerService
,特別是mutateLink
方法。 在Python,它會是這個樣子:
# Create the service object
managed_customer_service = client.GetService('ManagedCustomerService', version='v201605')
# Construct the operation, operator "ADD" and status "PENDING" results in a new invitation
operation = {
'operator': 'ADD',
'operand': {
'managerCustomerId': YOUR_MCC_ACCOUNT_ID,
'clientCustomerId': ACCOUNT_ID_TO_BE_INVITED,
'linkStatus': 'PENDING',
'pendingDescriptiveName': 'Some text that helps identifying the invitation',
'isHidden': False # This can be used to hide the account in your MCC to decrease clutter
}
}
# Send the operation
response = managed_customer_service.mutateLink([operation])
# Print out the resulting ManagedCustomerLink
pprint.pprint(response.links[0])
請注意,我沒有測試此代碼,但它應該給你它是如何工作的總體思路。請參閱reference guide以瞭解更多詳情,以及客戶帳戶接受邀請後如何繼續。
Python(桌面)應用程序中的廣告? – linusg
不,我只是希望能夠通過命令ping一個bot來鏈接帳戶。就像!命令,它發送一個待處理的邀請。 @linusg –
BadHorse