GetCustomer from Services.V2.CustomerService throws permission denied error

70 views
Skip to first unread message

Vinitha

unread,
Aug 13, 2019, 1:39:54 PM8/13/19
to AdWords API and Google Ads API Forum
Hello ,

So the below query returns a list of customer clients
Query = "SELECT customer.id,customer.descriptive_name,customer_client.resource_name, customer_client.descriptive_name,customer_client.client_customer,customer_client.level,customer_client.hidden FROM customer_client"


But when i try to  a customerService.GetCustomer(x) for each customerClient, if fails for one customer_client in the iteration with the following error
Failure:
Message: Status(StatusCode=PermissionDenied, Detail="The caller does not have permission")
Failure: { "errors": [ { "errorCode": { "authorizationError": "CUSTOMER_NOT_ENABLED" }, "message": "The customer can't be used because it isn't enabled." } ] }

Then why does it bring it in the first place from Customer_Clients if i do not have access? Even if it does how can i check the permission before i do a GetCustomer call on it so i can prevent the call from crashing and halting my application?


Thanks,
Vinitha.

Google Ads API Forum Advisor Prod

unread,
Aug 14, 2019, 9:11:59 AM8/14/19
to vin...@closedloop.com, adwor...@googlegroups.com
Hi Vinitha, 

The error CUSTOMER_NOT_ENABLED usually occurs if the API call is made against an account which is not completely setup. Could you please complete the account setup and retry the API request? If you're encountering any issues, could you please share the request and response logs using Reply privately to author option to investigate further?

Thanks,
Bharani, Google Ads API Team

ref:_00D1U1174p._5001UEIuRk:ref

vin...@closedloop.com

unread,
Aug 14, 2019, 12:08:58 PM8/14/19
to Google Ads API Forum Advisor Prod, adwor...@googlegroups.com

Hello ,

 

Thank you for your response. I understand that the account is not completely set up. But is there any field that I can bring back from following query to check if that condition

Query = "SELECT customer.id,customer.descriptive_name,customer_client.resource_name, customer_client.descriptive_name,customer_client.client_customer,customer_client.level,customer_client.hidden FROM customer_client" ?

 

I am only interested in getting back the completely setup accounts. Is there any way I can check that (filter completely set up accounts) before I can make a call to  GetCustomer?

 

Thank you,

Vinitha.

Google Ads API Forum Advisor Prod

unread,
Aug 14, 2019, 4:38:04 PM8/14/19
to vin...@closedloop.com, adwor...@googlegroups.com
Hi Vinitha, 

I'm afraid, it is not possible to identify if the accounts are in draft or completely setup through the API. If you are making an API call against the account that is not completely setup, this might fail with an error. 
Reply all
Reply to author
Forward
0 new messages