Re: Token has been expired or revoked

2021-04-19 Thread Every Straus

"Page doesn't work 
https://developers.google.com/google-ads/api/docs/first-call/oauth-cloud-project?hl=en
"
I figured out, this is because I have adblock extension, sorry.
понедельник, 19 апреля 2021 г. в 10:36:25 UTC+3, Every Straus: 

>
> "So our team can better assist you on your current setup, could you share 
> how the accounts you are accessing are currently structured?"
> We make app that can connect to different accounts, *not just **accounts 
> in** our MCC hierarchy, any google users adwords accounts, if user allow 
> access.*
> We get AuthorizationUri to connect google user with this code, with our 
> credentials
> $oauth2 = new OAuth2(
> [
> 'authorizationUri' => self::AUTHORIZATION_URI,
> 'redirectUri' => self::REDIRECT_URI,
> 'tokenCredentialUri' => CredentialsLoader::TOKEN_CREDENTIAL_URI,
> 'clientId' => $clientId,
> 'clientSecret' => $clientSecret,
> 'scope' => $scopes,
> 'state'=> $state,
> 'access_type' => 'offline',
> ]
> );
>
> $url = $oauth2->buildFullAuthorizationUri();
>
> return $url;
>
> Then we get refresh token, then user enter client_customer_id, and we get 
> account data from google adwords api and *this is work fine, 
> except refresh token expired or revoked and app was self removed.*
>
> Structure of accounts is 
> Manager account -> accounts or just account.
>
> We get data from different accounts, not just from our accounts in MCC, 
> and it's work now, questions is 
> 1) Why is refresh token expired or revoked?
> 2) Why app was self removed from 
> https://myaccount.google.com/u/1/permissions?
>
> "I would recommend that you reach out to the Google API Console support 
> team instead via this link 
> <https://support.google.com/googleapi/answer/7014572?hl=en>, for further 
> insight."
> How can I reach out to the Google API Console support team?
> Can you be more specific? 
>
> Lastly, yes, page doesn't work 
> https://developers.google.com/google-ads/api/docs/first-call/oauth-cloud-project?hl=en,
>  
> screenshot attached.
>
> понедельник, 19 апреля 2021 г. в 09:25:28 UTC+3, adsapiforumadvisor: 
>
>> Hi,
>>
>> Thank you for your follow up.
>>
>> If all your accounts are under or linked to a specific MCC hierarchy, you 
>> can generate the OAuth2 credentials using the user/email address that has 
>> access to the top most level MCC. This way, the OAuth2 credentials 
>> including the refresh token can be used across all accounts under the said 
>> MCC. There should be no need to generate OAuth2 credentials per user of 
>> your account(s).
>>
>> So our team can better assist you on your current setup, could you share 
>> how the accounts you are accessing are currently structured?
>>
>> In addition, regarding your question "*Maybe we need to request next 
>> level for developer token access, or something else?*", you may note 
>> that developer token access level is not required in the process of 
>> generating your OAuth2 credentials.
>>
>> Moving forward to your concern regarding your refresh tokens expiring, I 
>> would recommend that you reach out to the Google API Console support team 
>> instead via this link 
>> <https://support.google.com/googleapi/answer/7014572?hl=en>, for further 
>> insight.
>>
>> Lastly, could you confirm if my understanding is correct that you are 
>> unable to access this documentation 
>> <https://developers.google.com/google-ads/api/docs/first-call/oauth-cloud-project?hl=en>?
>>  
>> If yes, could you share the screenshot?
>>
>>
>> Best regards,
>>
>> [image: Google Logo] 
>> Peter Laurence Napa Oliquino 
>> Google Ads API Team 
>>   
>>
>> ref:_00D1U1174p._5004Q2FYAcl: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/787deee7-8ae7-4272-b41e-06aa86292252n%40googlegroups.com.


Re: Token has been expired or revoked

2021-04-16 Thread Every Straus
Hi,
Excuse me, but now I have more questions.

`In order to access (retrieve data, create, modify, delete) the said Google 
Ads accounts, users will need the appropriate OAuth2 credentials to 
authenticate those requests and perform specific actions. To achieve this, 
a user/email address will need first to have access to the Google Ads 
account which they will be managing.`

This is means, that we can't make refresh token, generating 
AuthorizationUri with our credentials, like that:

$oauth2 = new OAuth2(
[
'authorizationUri' => self::AUTHORIZATION_URI,
'redirectUri' => self::REDIRECT_URI,
'tokenCredentialUri' => CredentialsLoader::TOKEN_CREDENTIAL_URI,
'clientId' => $clientId,
'clientSecret' => $clientSecret,
'scope' => $scopes,
'state'=> $state,
'access_type' => 'offline',
]
);

$url = $oauth2->buildFullAuthorizationUri();

return $url;

Then user go to url, allow access and we get refresh token, and that 
solution work fine, except self removing app from 
https://myaccount.google.com/u/1/permissions.

If I understand right,
what you said, means, that we need to access, from our clients to every 
user google account and make for every account unique credentials.(Client 
ID,Client secret)

If so, how we can generate right refresh token with ours credentials?
Maybe we need to request next level for developer token access, or 
something else?

`As for the expiring (refresh) token issue, this guide that you mentioned 
initially provides the reasons that may cause the said token to expire. If 
your Everystraus user was removed then it is possible that someone that has 
access to your accounts removed or revoked your access.`

Ours employes not remove app from 
https://myaccount.google.com/u/1/permissions
Maybe, you can check that or way its happend? 
Because, if app self removing from 
https://myaccount.google.com/u/1/permissions and this will be happening 
often, it's not good.

This page doesn't work 
https://developers.google.com/google-ads/api/docs/first-call/oauth-cloud-project(Service
 
Unavailable)
пятница, 16 апреля 2021 г. в 06:04:14 UTC+3, adsapiforumadvisor: 

> Hi,
>
> Thank you for your follow up. I work with Matt and allow me to assist you.
>
> A basic access level developer token only allows users to use the API to 
> make requests to Production Google Ads accounts.
>
> In order to access (retrieve data, create, modify, delete) the said Google 
> Ads accounts, users will need the appropriate OAuth2 credentials to 
> authenticate those requests and perform specific actions. To achieve this, 
> a user/email address will need first to have access 
> 
>  
> to the Google Ads account which they will be managing.
>
> Once the user/email address has the required access, they can then generate 
> the OAuth2 credentials 
> 
>  
> (https://console.cloud.google.com/apis/credentials) while logged in to 
> that user/email address that has access to the Google Ads account.
>
> As for the expiring (refresh) token issue, this guide 
>  that 
> you mentioned initially provides the reasons that may cause the said token 
> to expire. If your Everystraus user was removed then it is possible that 
> someone that has access to your accounts removed or revoked your access.
>
> Best regards,
>
> [image: Google Logo] 
> Peter Laurence Napa Oliquino 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2FYAcl: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/43dcc2ec-795e-4a4b-8003-a29739ae9f6en%40googlegroups.com.


Re: Token has been expired or revoked

2021-04-14 Thread Every Straus

Thank you for reply.

`Can you please try regenerating your OAuth2 credentials and refresh token`

For be more specific.

We need to create new credentials here 
https://console.cloud.google.com/apis/credentials ?

We make service, that can connect to different accounts, we already have 
basic access in Google Adwords Api.
So what this is mean (ensuring that the email being used to create the 
credentials has the proper access level in your Ads MCC)?
If different client give access to our app then error will be happen again 
'Token has been expired or revoked' ?

Maybe we need to fill out the form differently, or some thing else.
среда, 14 апреля 2021 г. в 17:01:27 UTC+3, adsapiforumadvisor: 

> Hello,
>
> Thanks for reaching out. Can you please try regenerating your OAuth2 
> credentials and refresh token, and ensuring that the email being used to 
> create the credentials has the proper access level in your Ads MCC?
>
> Thanks,
> Matt
> Google Ads API Team
>
> [image: Google Logo] 
> Matt 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2FYAcl: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/086ca4b8-72f5-4c9c-a3e6-e7cff5b22ae0n%40googlegroups.com.


Token has been expired or revoked

2021-04-13 Thread Every Straus
Hello.

We have error "Token has been expired or revoked"

We don`t make any changes.

And in page https://myaccount.google.com/u/1/permissions our app 
Everystraus was self removed.

We don`t did that.

I read 
https://groups.google.com/u/1/g/adwords-api/c/PWuTWEBR98Q/m/FoDufLdgAwAJ
https://groups.google.com/u/1/g/adwords-api/c/O4ie7zrzh_I/m/iIYaXUTDAQAJ
https://developers.google.com/identity/protocols/oauth2#expiration

And this was not helpful.

Please help.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/a03a6238-8a20-4703-a839-9ef8970d3b00n%40googlegroups.com.
[2021-04-13 16:11:22] local.INFO: array (
  'command' => 'GoogleGetKeywordsStatistics {user_id} {google_acc_id} 
{client_customer_id} {startDate} {endDate}',
  'user_id' => '1',
  'google_acc_id' => '12',
  'client_customer_id' => '522-368-2215',
)  
[2021-04-13 16:11:22] local.INFO: GuzzleHttp\Exception\ClientException: Client 
error: `POST https://oauth2.googleapis.com/token` resulted in a `400 Bad 
Request` response:
{
  "error": "invalid_grant",
  "error_description": "Token has been expired or revoked."
}
 in 
/var/www/everystraus.su/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
Stack trace:
#0 /var/www/everystraus.su/vendor/guzzlehttp/guzzle/src/Middleware.php(69): 
GuzzleHttp\Exception\RequestException::create()
#1 /var/www/everystraus.su/vendor/guzzlehttp/promises/src/Promise.php(204): 
GuzzleHttp\Middleware::GuzzleHttp\{closure}()
#2 /var/www/everystraus.su/vendor/guzzlehttp/promises/src/Promise.php(153): 
GuzzleHttp\Promise\Promise::callHandler()
#3 /var/www/everystraus.su/vendor/guzzlehttp/promises/src/TaskQueue.php(48): 
GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}()
#4 /var/www/everystraus.su/vendor/guzzlehttp/promises/src/Promise.php(248): 
GuzzleHttp\Promise\TaskQueue->run()
#5 /var/www/everystraus.su/vendor/guzzlehttp/promises/src/Promise.php(224): 
GuzzleHttp\Promise\Promise->invokeWaitFn()
#6 /var/www/everystraus.su/vendor/guzzlehttp/promises/src/Promise.php(269): 
GuzzleHttp\Promise\Promise->waitIfPending()
#7 /var/www/everystraus.su/vendor/guzzlehttp/promises/src/Promise.php(226): 
GuzzleHttp\Promise\Promise->invokeWaitList()
#8 /var/www/everystraus.su/vendor/guzzlehttp/promises/src/Promise.php(62): 
GuzzleHttp\Promise\Promise->waitIfPending()
#9 /var/www/everystraus.su/vendor/guzzlehttp/guzzle/src/Client.php(123): 
GuzzleHttp\Promise\Promise->wait()
#10 
/var/www/everystraus.su/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/AdsGuzzleProxyHttpHandler.php(63):
 GuzzleHttp\Client->send()
#11 /var/www/everystraus.su/vendor/google/auth/src/OAuth2.php(526): 
Google\AdsApi\Common\AdsGuzzleProxyHttpHandler->__invoke()
#12 
/var/www/everystraus.su/vendor/google/auth/src/Credentials/UserRefreshCredentials.php(110):
 Google\Auth\OAuth2->fetchAuthToken()
#13 
/var/www/everystraus.su/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/Util/OAuth2TokenRefresher.php(66):
 Google\Auth\Credentials\UserRefreshCredentials->fetchAuthToken()
#14 
/var/www/everystraus.su/vendor/googleads/googleads-php-lib/src/Google/AdsApi/AdWords/Reporting/v201809/RequestOptionsFactory.php(86):
 Google\AdsApi\Common\Util\OAuth2TokenRefresher->getOrFetchAccessToken()
#15 
/var/www/everystraus.su/vendor/googleads/googleads-php-lib/src/Google/AdsApi/AdWords/Reporting/v201809/RequestOptionsFactory.php(186):
 Google\AdsApi\AdWords\Reporting\v201809\RequestOptionsFactory->createHeaders()
#16 
/var/www/everystraus.su/vendor/googleads/googleads-php-lib/src/Google/AdsApi/AdWords/Reporting/v201809/ReportDownloader.php(156):
 
Google\AdsApi\AdWords\Reporting\v201809\RequestOptionsFactory->createRequestOptionsWithAwqlQuery()
#17 
/var/www/everystraus.su/app/Console/Commands/Google/Statistics/GoogleGetKeywordsStatistics.php(103):
 
Google\AdsApi\AdWords\Reporting\v201809\ReportDownloader->downloadReportWithAwql()
#18 
/var/www/everystraus.su/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36):
 App\Console\Commands\Google\Statistics\GoogleGetKeywordsStatistics->handle()
#19 
/var/www/everystraus.su/vendor/laravel/framework/src/Illuminate/Container/Util.php(37):
 Illuminate\Container\BoundMethod::