Hi, Is the issue that:
a. You aren't getting back the OAuth credential from your *GetOAuth2Credential* call? OR b. You are getting back the OAuth credential, but you're not sure what to do next? If a), then I'd recommend going through the PHP library's OAuth2 guide <https://github.com/googleads/googleads-php-lib/wiki/Using-OAuth-2.0>. If b), then the Making Your First Request guide <https://developers.google.com/adwords/api/docs/first-request> has some helpful instructions for each client library. Just make sure you click the *PHP* tab, and the guide will show you how to configure the library and make an API request. Also, you mentioned that you wanted to get account information based on the OAuth credentials. Each user is associated with only *one* AdWords account (either a Manager Account <https://support.google.com/adwords/answer/6139186> or a regular AdWords account), and you can get that account's information by issuing a CustomerService.get <https://developers.google.com/adwords/api/docs/reference/v201509/CustomerService#get> call. This will give you back the clientCustomerId <https://developers.google.com/adwords/api/docs/guides/basic-concepts#soap_headers> (among other things) of the account associated with your OAuth credentials. Hope that helps! Cheers, Josh, AdWords API Team On Tuesday, October 13, 2015 at 3:14:15 PM UTC-4, etienne...com wrote: > > Hi Umesh and thank you for your response. > > looked at the link you sent me and in fact the code I have included in my > original publication does just that. The visitor is sent to an access > request page to the Google server and the visitor is sent back to my page > with an authorization code. > > I use this snippet of code to request access to the account of the visitor: > > $ user = new AdWordsUser (); > $ user-> LogAll (); > $ user-> SetOAuth2Info (array ( > "client_id" => $ clientId, > "client_secret" => $ clientSecret > )); > > > // Generate an authorization callback URL Given the URL > authUrl GetOAuth2Credential $ = ($ user, $ callbackUrl); > // header ("Location:" $ authUrl.); > echo '<a href="'.$authUrl.'"> </a> Start process'; > > > Look at my complete code in the original publication. > > My code, I think is good because it returns an authorization code. I don't > understand what I am doing wrong. > > I am open to any proposal. > > Thank you ! > > On Friday, October 9, 2015 at 4:07:51 PM UTC-4, Umesh Dengale wrote: >> >> Hello, >> >> The user has to grant access to their manager account(MCC) to get access >> to their AdWords accounts information. Please go through the OAuth2.0 >> for Web Server Applications guide >> <https://developers.google.com/identity/protocols/OAuth2WebServer> for >> more details. >> >> Thanks, >> Umesh, AdWords API Team. >> > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and Google+: https://googleadsdeveloper.blogspot.com/ https://plus.google.com/+GoogleAdsDevelopers/posts =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] 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 Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. Visit this group at http://groups.google.com/group/adwords-api. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/cf036b7c-86df-4ea4-ae9d-df519c7b69d8%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
