Hi Ben,

I have just read in another thread that the Master Account needs to be set 
up under a unique gmail address.  My Master Account is under the same email 
address that owns my Sub Ad Accounts.  Is this the reason for my OAuth 
issues?

Regards,
Martin

On Wednesday, December 1, 2021 at 11:43:35 PM UTC+2 Martin Levi wrote:

> Hi Ben,
>
> I have been diving in to the documentation on the client library from your 
> link.  I looked at this before, and now I remember more clearly why I was 
> reluctant to use a Client Library.
>
> I do not have any local PHP environment.  From what I understand at first 
> glance, to run a test locally I would need at a minimum PHP for Windows, 
> PECL, Composer, gRPC, and only then can I install and run the PHP Client 
> Library.  To use the Client Library on my hosted web server I obviously 
> have PHP, and there is an option to install CodeGen_PECL (1.1.3).  It is 
> not clear to me what other installations I would need, but in any case I 
> don't need to touch my cron job; it is a standalone process whose only 
> function is to provide (in a file) a continuously refreshed oauth 2.0 
> access token.
>
> Is it possible to analyze the curl logs I sent you?  Here is the relevant 
> code I ran:
>
> *$baseURL = 
> 'https://googleads.googleapis.com/v9/customers:listAccessibleCustomers 
> <https://googleads.googleapis.com/v9/customers:listAccessibleCustomers>';*
>
> *$headers = [*
> *    'Host: googleads.googleapis.com <http://googleads.googleapis.com>',*
> *    'User-Agent: curl',*
> *    'Content-Type: application/json',*
> *    'Accept: application/json',*
> *    'Authorization: Bearer '.get_gg_oauth2_token(),*
> *    'developer-token: '.get_gg_developer_token (),*
> *    'login-customer-id: '.get_gg_manager_customer_id ()*
> *];*
>
> *$curl = curl_init();*
> *curl_setopt($curl, CURLOPT_URL, $baseURL);*
> *curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);*
> *curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);*
> *curl_setopt($curl, CURLOPT_VERBOSE, true);*
> *$streamVerboseHandle = fopen(private_folder().'/curl_log.txt', 'w+');*
> *curl_setopt($curl, CURLOPT_STDERR, $streamVerboseHandle);*
>
> *$response = curl_exec($curl);*
> *$responseFile = fopen(private_folder().'/curl_response.txt', 'w');*
> *fwrite($responseFile, $response);*
> *curl_close ($curl);*
>
> You can see the exact headers that were sent in the curl_log.txt file that 
> I sent to you privately.
>
> Regards,
> Martin
>
> On Wednesday, December 1, 2021 at 8:27:10 PM UTC+2 Martin Levi wrote:
>
>> Hi Ben,
>>
>> I'm still a little concerned about my account setup since the 
>> documentation is dispersed over several different documents that are all 
>> written for a variety of use cases.  Also the curl response contains the 
>> message: "User in the cookie is not a valid Ads user."
>>
>> I will set up the client library in a few hours when my kids are in bed!  
>> Meanwhile I will send you privately the logs from my curl request; if there 
>> is an error in my access token retrieval it should be apparent from the 
>> request log.
>>
>> Regards,
>> Martin
>> On Wednesday, December 1, 2021 at 6:58:52 PM UTC+2 adsapi wrote:
>>
>>> Thanks Martin,
>>>
>>> As far as I can tell your account set up looks OK, but since it lives in 
>>> Pantheon I can't examine your account directly so I can't be 100% sure.
>>>
>>> One benefit of using a client library is it will handle the process of 
>>> generating and refreshing your access token automatically, which might be 
>>> very valuable in this case. While I look over your script below, would you 
>>> mind running a basic test to see if the PHP client library can make a 
>>> successful request with your existing service account credentials? The 
>>> documentation for setting up the library is here 
>>> <https://developers.google.com/google-ads/api/docs/client-libs/php/oauth-service>.
>>>  
>>> You should be able to execute the test locally to verify it, so that you 
>>> don't have to modify your cron job script. Mainly I'm curious if you get 
>>> the same error, if not, and the request succeeds, then there might be an 
>>> issue with your logic that retrieves the access token.
>>>
>>>
>>> Thanks,
>>> Ben, Google Ads API Team
>>>
>>> ref:_00D1U1174p._5004Q2R74x8:ref
>>>
>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/6b2ea802-0be7-4959-ac78-da210f9b1c39n%40googlegroups.com.
  • Se... Martin Levi
    • ... 'Google Ads API Forum Advisor' via AdWords API and Google Ads API Forum
      • ... Martin Levi
        • ... Martin Levi
          • ... 'Google Ads API Forum Advisor' via AdWords API and Google Ads API Forum
            • ... Martin Levi
              • ... 'Google Ads API Forum Advisor' via AdWords API and Google Ads API Forum
                • ... Martin Levi
                • ... Martin Levi
                • ... Martin Levi
                • ... 'Google Ads API Forum Advisor' via AdWords API and Google Ads API Forum

Reply via email to