- Does anybody know after how much time or how many requests does refresh token expires in Google ads API? I created refresh token here https://developers.google.com/oauthplayground.
- Does anyone know what is the impersonated email in server account in Google ads API? I created server account in Google cloud project. If I run python code with Service Account configuration with generated json_key_file_path and same impersonated_email as my email account with which I created project then I get an error
google.auth.exceptions.RefreshError: ('unauthorized_client: Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested.', {'error': 'unauthorized_client', 'error_description': 'Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested.'})
. If I put for impersonated_email client_email that I got from generated jon file I get an error: User in the cookie is not a valid Ads user.
Tag:google-ads-api, google-oauth, refresh-token, oauth2-playground, clientid
Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested.
Is a common error message. There are serval types of clients in Google developer console that you can create
installed web native service account. mobileThe coded needed to authorize these different types of authorization methods is also different.
The Oauth playground by default uses web app credentials. You can add your own web credentials in there and create a token for your own system. But this is only used for testing.
You cant though use a token created via playground in code used for an android application, its the wrong type of authorization flow. You will need to crate your own mobile credentials and authorize though your application.