Hello.

We have been using the AdWords API for months, and implemented an OAuth 
login feature months ago. We were using it until 2 days ago, but suddenly 
we started getting the "invalid request" error, which is as follows:


OAuth2Exception in 
googleads-php-lib/src/Google/Api/Ads/Common/Util/SimpleOAuth2Handler.php 
line 119:{
"error" : "invalid_request"
}


I tried with different client ID and secret couples, but got the same 
error. I also tried the example codes which are called *GetRefreshToken.php 
*and *GetRefreshTokenWithoutIniFile.php* from the 
*googleads\googleads-php-lib\examples\AdWords\Auth\* path. I tried 
different things but unable to authenticate myself as the API client.

I am using the following piece of code, where I get the error in the last 
line:

$user = new AdWordsUser();
$user->SetDeveloperToken(env('DEVELOPER_TOKEN'));
$user->SetUserAgent(env("USER_AGENT"));

$OAuth2Handler = $user->GetOAuth2Handler();
$credentials = $OAuth2Handler->GetAccessToken($this->clientCredentials, 
$authCode, $this->callbackUrl);


The variable "clientCredentials" contains my client ID and client Secret, 
"authCode" is the authentication code that came as the parameter to the 
callback URL, and callback URL is my callback URL. I have been using this 
setup for more than 3 months, but for the last 2 days it constantly gives 
me the "invalid request" error.

Thanks for any help. I can provide more details if you want.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/023a2402-edcd-461c-a2d6-04c560edaecb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • PHP - Invalid ... Burak Karakan
    • Re: PHP -... 'Shwetha Vastrad (AdWords API Team)' via AdWords API Forum
      • Re: P... Burak Karakan
        • R... Burak Karakan
          • ... 'Nadine Sundquist (AdWords API Team)' via AdWords API Forum
            • ... Sabri Karagönen
            • ... Burak Karakan
            • ... Burak Karakan
              • ... 'Nadine Sundquist (AdWords API Team)' via AdWords API Forum

Reply via email to