Hello Dominik,
Thank you for reaching out. Could you please confirm if you are looking to fetch the customer within your MCC account and apply for access for these customer accounts via API? If my understanding is correct, you could use ManagedCustomerService to get the account hierarchy under your manager account. Please refer to the complete code sample available here. Also, refer to this guide for linking your manager account to client customer account using API. For your concern related to applying the access for your customer account, you might find this guide useful to generate the OAuth2 credentials via API. Please note, you need to authorize using the AdWords scope to make calls via AdWords API. Let us know if you need any additional information.
Regards,
Nikisha Patel, Google Ads API Team
Hello Dominik,
Thank you for clarifying your requirements better. With regards to your concerns, the client accounts must be linked to your MCC account(manager). Linking a manager and client account allows the manager account to make requests on behalf of its client accounts. If you want to perform this operation via API, the manager account must extend an invitation to the client account and the client must accept the invitation. However, as you mentioned, you do not have client customer id of the client accounts to extend the invitation, that being said, you need to get the account id details from the clients to extend an invitation. Please find my response on the steps followed on your end.
Fetch his account hierarchy to get a list of his ad accounts: It is not possible to fetch the account hierarchy of their accounts as you are not authenticated to make calls against their account.
Send an invitation to the Ads account to be managed by our MCC: You can refer to this guide to send an invitation to their account using API to link them under your manager account and access the data within their account to create and edit ads performance report.
{ "StatusCode": 3, "Details": "Request contains an invalid argument.", "RequestId": "NBFq6ewcP6qm-F0wW2m0yg", "Failure": { "errors": [ { "errorCode": { "fieldError": "INVALID_VALUE" }, "message": "The field's value is invalid.", "trigger": { "int64Value": "3" }, "location": { "fieldPathElements": [ { "fieldName": "operation" }, { "fieldName": "update" }, { "fieldName": "status" } ] } } ] }}
{ "StatusCode": 3, "Details": "Request contains an invalid argument.", "RequestId": "GnFZoIlG0fNNCg3FaGkD4g", "Failure": { "errors": [ { "errorCode": { "customerClientLinkError": "CLIENT_ALREADY_MANAGED_IN_HIERARCHY" }, "message": "The client sending the invitation already has a manager.", "trigger": { "stringValue": "" }, "location": { "fieldPathElements": [ { "fieldName": "operation" } ] } } ] }}