Can developer token work with any test account?

368 views
Skip to first unread message

Tal Lipits

unread,
May 12, 2020, 10:35:55 AM5/12/20
to AdWords API and Google Ads API Forum

Hi


Can developer token work with any test account?

Developer token (created with a production manager account) and a test account were created using different google ids.

Is the only thing that makes my calls work with a test account is a test customer id?


Trying to understand the required level of authentication


Thanks a lot,

Tal

SUBINPVASU

unread,
May 12, 2020, 10:53:12 AM5/12/20
to tal...@gmail.com, AdWords API and Google Ads API Forum
You need a developer token to make api calls.
For using different accounts, either it should be under the same mcc or you need separate developer tokens

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/57a5372b-979c-4e0c-9b97-5c14c5f1a403%40googlegroups.com.


--
subinpvasu
9495546474

Tal Lipits

unread,
May 12, 2020, 11:02:22 AM5/12/20
to AdWords API and Google Ads API Forum
Thanks
Can I create them under same mcc, if one is production mgr account and the other is test mgr account?


On Tuesday, May 12, 2020 at 5:53:12 PM UTC+3, SUBINPVASU wrote:
You need a developer token to make api calls.
For using different accounts, either it should be under the same mcc or you need separate developer tokens

On Tue, May 12, 2020 at 8:05 PM Tal Lipits <tal...@gmail.com> wrote:

Hi


Can developer token work with any test account?

Developer token (created with a production manager account) and a test account were created using different google ids.

Is the only thing that makes my calls work with a test account is a test customer id?


Trying to understand the required level of authentication


Thanks a lot,

Tal

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to

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 adwor...@googlegroups.com.


--
subinpvasu
9495546474

Google Ads API Forum Advisor Prod

unread,
May 12, 2020, 2:13:18 PM5/12/20
to tal...@gmail.com, adwor...@googlegroups.com
Hi Tal,

You can use a developer token on your test and production account. They can use the same token but you will need to generate separate credentials. 

Cheers,
Anthony
Google Ads API Team

ref:_00D1U1174p._5004Q1zLW3d:ref

Tal Lipits

unread,
May 13, 2020, 2:29:00 AM5/13/20
to AdWords API and Google Ads API Forum
Thanks Anthony
By separate credentials do you refer to the oauth client_id, client_secret and refresh_token?

Google Ads API Forum Advisor Prod

unread,
May 13, 2020, 9:55:46 AM5/13/20
to tal...@gmail.com, adwor...@googlegroups.com
Hi Tal,

Yes, that's correct. Let me know if you face any issues.

Tal Lipits

unread,
May 13, 2020, 12:19:34 PM5/13/20
to AdWords API and Google Ads API Forum
Hi Anthony,

Thanks a lot for clarifying this.

I tried that, and I'm getting AuthenticationError.OAUTH_TOKEN_INVALID.
And like I wrote Danica in this thread, I'm not sure if this is because I didn't specify a client_customer_id?

I coudn't create a test adwords client account using the ways suggested by google's documentation, as I described here (this is another issue, which seems to be unclear if it's product team or API team to solve).
Is there a way to run the code below without creating a test adwords client account? (I do have a working test adwords manager account)

client = adwords.AdWordsClient.LoadFromStorage(f'{os.getcwd()}/oauth/googleads.yaml')
# Initialize appropriate service.
campaign_service = client.GetService('CampaignService', version='v201809')
# Construct selector and get all campaigns.
offset = 0
selector = {
   
'fields': ['Id', 'Name', 'Status'],
   
'paging': {
       
'startIndex': str(offset),
       
'numberResults': str(PAGE_SIZE)
    }
}
more_pages =
True
while
more_pages:
    page = campaign_service.get(selector)
# this line throws the exception

Google Ads API Forum Advisor Prod

unread,
May 13, 2020, 1:47:07 PM5/13/20
to tal...@gmail.com, adwor...@googlegroups.com
Hi Tal,

Unfortunately, you won't be able to run the code you have under a manager account. It needs to be a client account. The issue you mentioned is a product related issue, not an API one. You should be able to create a test client account by running this code. Here are details on the OAUTH_TOKEN_INVALID error you are facing. You should include your client_customer_id in your headers.

Regards,

Tal Lipits

unread,
May 14, 2020, 2:45:17 AM5/14/20
to AdWords API and Google Ads API Forum
Hi Anthony,

Thanks for the link. I tried running the code, but got AuthenticationError.OAUTH_TOKEN_INVALID when calling managed_customer_service.mutate(operations).
My config yaml has client_id, client_secret and refresh_token which I created by following the steps in this doc.
I get this exception when using both of my adwords manager accounts - production and test.
I also followed the steps suggested in OAUTH_TOKEN_INVALID, but using refresh token, rather than access token.

If customer id is required to path authentication, then may be I need to have an initial customer id in order to create new customers using this code? In other words, may be the initial step has to be from the UI?

So I guess the next step for me is to have my developer token approved for basic level access, by filling up this form and waiting for approval, correct?

Thanks a lot for all the help and references,
Tal

Google Ads API Forum Advisor Prod

unread,
May 14, 2020, 12:15:52 PM5/14/20
to tal...@gmail.com, adwor...@googlegroups.com
Hi Tal,

When creating the test client account, you should use the credentials for the test manager account and specify its CID here. If you continue to face issues, you may need to create through the UI. The form you mentioned is the correct form to get Basic access.

Tal Lipits

unread,
May 14, 2020, 12:42:10 PM5/14/20
to AdWords API and Google Ads API Forum
Hi Anthony, 

Yes, this is what I did.
I guess for now I will wait for my dev token to get Basic access approval.
Alternatively if creating a test client using the UI works again, I would use that.

Thanks for all the assistance,
Tal

Tal Lipits

unread,
May 17, 2020, 8:23:24 AM5/17/20
to AdWords API and Google Ads API Forum
Hi Anthony,

I managed to get a customer id.
I have now all of these:
adwords:
  developer_token: ...
  client_customer_id: ...
user_agent: ...
  client_id: ...
  client_secret: ...
  refresh_token: ...
  
Not sure if my user_agent is correct, didn't find any reference to what value should be there (company name, but which format, etc)

I've tried to debug it using OAuth playground, but it requires to list the URL developers.google.com/oauthplayground in the Authorized redirect URIs (in developers console>project>Credentials>OAuth 2.0 client Ids). Unfortunately this setting exists only for web application, whereas google adwords test account requires a 'desktop app' / 'other app'. I used 'other app'.
Any idea what else can I check?
Thanks,
Tal



Still getting AuthenticationError.OAUTH_TOKEN_INVALID.



On Thursday, May 14, 2020 at 7:15:52 PM UTC+3, adsapiforumadvisor wrote:

Tal Lipits

unread,
May 17, 2020, 11:42:31 AM5/17/20
to AdWords API and Google Ads API Forum
Hi Anthony, 

Worth noting that I am able to use OAuth Playground and get a fresh Access token out of my Refresh tokenOAuth Client ID and OAuth Client secret, per the Adwords API.
I would presume that if that works, then my call to CampaignService should not return with AuthenticationError.OAUTH_TOKEN_INVALID.
btw - the google id I use for these tests is tal.at....@gmail.com

Thanks a lot,
Tal

Google Ads API Forum Advisor Prod

unread,
May 18, 2020, 11:59:17 AM5/18/20
to tal...@gmail.com, adwor...@googlegroups.com
Hi Tal,

The userAgent is optional. You can enable your logs and provide me the SOAP requests and responses so that I can take a closer look at why you are getting that error. For example, here is how to enable logs in the Java client library  Please send your logs via reply privately to author.

Abdur Rehman

unread,
Feb 7, 2025, 7:30:24 PMFeb 7
to Google Ads API and AdWords API Forum

Hi Anthony,
My MCC developer token is in test Account and I have link one of my local service customer to my MCC account. I have local service account (GCP) which is not is production yet. So when I try to get leads of my customer I get 403. Can you tell me due to which reason why I'm getting 403 you have access to this manager account id XXXXXXXXXX.

Google Ads API Forum Advisor

unread,
Feb 10, 2025, 5:26:28 PMFeb 10
to abdurreh...@gmail.com, adwor...@googlegroups.com
Hi,

As per provided information, I understand that you're encountering the 403 'PERMISSION_DENIED' error. I would like to inform you that this is an authorization error that usually occurs when the authorized customer does not have access to the operating customer. To analyze your issue further could you provide us with the below details. You can send the details via Reply privately to the author option, or direct private reply to this email.

 
This message is in relation to case "ref:!00D1U01174p.!5004Q01zLW3d:ref" (ADR-00035872)

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5


 


Reply all
Reply to author
Forward
0 new messages