If that works, then generate an access token from that refresh token in a Bash Terminal.
Now, we want to check the data on the access token to make sure everything on the access token is working as expected. Put this in your browser with the access token inserted that you got back.
If that works, then let's try a request from the command line:
|
||||||
GoogleAdsException at /listing(<_SingleThreadedRendezvous of RPC that terminated with:status = StatusCode.INVALID_ARGUMENTdetails = "Request contains an invalid argument."debug_error_string = "{"created":"@1658904934.409000000","description":"Error received from peer ipv4:142.250.200.138:443","file":"src/core/lib/surface/call.cc","file_line":953,"grpc_message":"Request contains an invalid argument.","grpc_status":3}">, <_SingleThreadedRendezvous of RPC that terminated with:status = StatusCode.INVALID_ARGUMENTdetails = "Request contains an invalid argument."debug_error_string = "{"created":"@1658904934.409000000","description":"Error received from peer ipv4:142.250.200.138:443","file":"src/core/lib/surface/call.cc","file_line":953,"grpc_message":"Request contains an invalid argument.","grpc_status":3}">, errors {error_code {request_error: INVALID_CUSTOMER_ID}message: "Invalid customer ID \'\'."}request_id: "Vn8OyAiSL6hALb_i1O7feA", 'Vn8OyAiSL6hALb_i1O7feA')
Hi Miguel,
Thanks for getting back to us.
Upon checking the stacktrace you’ve provided with us, I can see that you’ve encountered an INVALID_CUSTOMER_ID error. It appears that the customer_id field is not set in your request or customer_id is added with hyphens (-). Could you please double check if you’re indeed using the correct CID on your end without hyphens (-)?
If you’re running Python client library code using terminal, then the value is passed via the command line when executing the example, so for instance, note the -c flag in the below command:
python examples/basic_operations/get_campaigns.py -c 123456789
With regards to questions asked in above email, you may see below responses:
I want the top left - middle accounts drop down (accounts under my MCC), so I guess I have to use https://developers.google.com/google-ads/api/docs/account-management/get-account-hierarchy, right?
>> Your understanding is correct.
If I understand correctly the comments on that code, sending login_customer_id is not required but the API query should work OK if I send the login_customer_id (just like I'm doing in the other API queries that are working OK), right?
>> your understanding is correct. Login_customer_id is optional for this guide.
I guess I don't need to send any Customer ID (it wouldnt make sense, because what I want to get is the list of Customer IDs under my MCC), but I still get the INVALID_CUSTOMER_ID error when I don't provide any.
>> Could you provide us with the complete request and response logs with the request-id generated after following the logging guide , so our team can better check?
For the Python client library, logging can be enabled by navigating to the Client libraries > Your client library (select Python) > Logging documentation, which you can access from this link. You may then send the requested information via the Reply privately to author option.
Also, do I have to use all the code on https://developers.google.com/google-ads/api/docs/account-management/get-account-hierarchy just to get a simple list of the Customer IDs (I don't care about hierarchy, I just want a simple list of IDs)?
>> This example fetches the account hierarchy of the specified manager account and login customer ID. If you don't specify manager ID and login customer ID, the example will instead print the hierarchies of all accessible customer accounts for your authenticated Google account. Note that if the list of accessible customers for your authenticated Google account includes accounts within the same hierarchy, this example will retrieve and print the overlapping portions of the hierarchy for each accessible customer.
Seems a super complex code to get something very simple. All my other API queries are basically just the GAQL query, a couple of lines of Python code to process the info from the query and that's it. There is no simple solution like this to get a list of the Customer IDs?
>> You may also use customer_client report to get the list of the Customer IDs under the manager account.
Regards,
|
||||||