ListAccessibleCustomers

136 views
Skip to first unread message

cv

unread,
Aug 28, 2023, 8:39:22 AM8/28/23
to Google Ads API and AdWords API Forum

Hello,

I've observed that the ListAccessibleCustomers function is providing information about all customers, including those that are currently in the "SetUp in progress" status. In my specific use case, I retrieve information about each customer by using the following query:

$query = 'SELECT customer.id, customer.manager, customer.test_account, customer.time_zone, customer.descriptive_name, customer.currency_code FROM customer WHERE customer.test_account != TRUE';

However, the problem arises due to attempting to access customers while their setup is still in progress.

How can I exclude accounts that are currently in the setup process?

Will this adjustment provide a more specific error message instead of the general "The caller does not have permission" message?

Google-Ads.png{

    "message": "The caller does not have permission",
    "code": 7,
    "status": "PERMISSION_DENIED"
}

Google Ads API Forum Advisor

unread,
Aug 29, 2023, 1:35:18 PM8/29/23
to chirag....@gmail.com, adwor...@googlegroups.com

Hi,

Thank you for reaching out to the Google Ads API support team.

With regard to your concern, you may check this documentation guide (https://developers.google.com/google-ads/api/docs/account-management/listing-accounts) for you to list customers accessible to you with the ListAccessibleCustomers (https://developers.google.com/google-ads/api/reference/rpc/v14/CustomerService#listaccessiblecustomers) method in CustomerService (https://developers.google.com/google-ads/api/reference/rpc/v14/CustomerService). However, it is necessary to understand which customers are returned in this type of request. You may also retrieve the list of ENABLED accounts using the customer_client resource.

This message is in relation to case "ref:_00D1U1174p._5004Q2o8mgY:ref"

Thanks,
 
Google Logo Google Ads API Team

 

cv

unread,
Aug 30, 2023, 1:35:25 AM8/30/23
to Google Ads API and AdWords API Forum
I apologize if my previous explanation was unclear.

When using the ListAccessibleCustomers function, it returns resource names of customers directly accessible by the user authenticated for the call. This includes accounts that are currently in the setup process. The challenge arises when you attempt to call the customer_client resource using the customerID obtained from ListAccessibleCustomers. Since the customerID includes resource names of accounts in setup, it can lead to a PERMISSION_DENIED error.

This situation seems to pose an issue in distinguishing between fully accessible customers and those that are still in setup. The returned resource names from ListAccessibleCustomers lack the necessary filtering to exclude setup in-progress accounts. Consequently, it becomes difficult to prevent the inclusion of setup accounts in the accessible customers' list.

In essence, your concern revolves around the fact that the ListAccessibleCustomers response contains customer resource names that include both fully accessible accounts and those that are still in the setup process, making it challenging to differentiate between the two. This issue needs to be addressed to ensure a smoother workflow and accurate distinction between accessible and setup in-progress accounts.


Google Ads API Forum Advisor

unread,
Aug 30, 2023, 5:53:22 AM8/30/23
to chirag....@gmail.com, adwor...@googlegroups.com

Hi, 

Thank you for getting back to us. 

I understand that ListAccessibleCustomers returns resource names of customers directly accessible by the user authenticated for the call. Please note that the resulting list of customers is based on your OAuth credentials. The request returns a list of all accounts that you are able to act upon directly given your current credentials. This will not necessarily include all accounts within the account hierarchy; rather, it will only include accounts where your authenticated user has been added with admin or other rights in the account. With regards to your concern with the accounts in the setup process being included and leading to a PERMISSION_DENIED error, could you provide us with the complete API logs (request and response with request-id) generated on your end showing this error? This is so we could further check your use case and provide more appropriate guidance. 

If you haven't enabled the logging yet, logging can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link (https://developers.google.com/google-ads/api/docs/client-libs?hl=en).

You may then send the requested information privately via the Reply to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com  alias instead.

In addition, you may also check this section (https://developers.google.com/google-ads/api/docs/account-management/listing-accounts?hl=en#list_cancelled_accounts) for retrieving the list of ENABLED accounts using the customer_client resource.

Reference Links:

Reply all
Reply to author
Forward
0 new messages