Google Ads API Error - Developer token is not allowed with project

103 views
Skip to first unread message

Anoop Kumar

unread,
Jul 24, 2024, 8:01:39 PM7/24/24
to Google Ads API and AdWords API Forum
Hi Team,

Greetings!

Use case : To get the Google Ads API from a Google Ads MCC Account (Eg: 1234567).
Problem : I am getting the error " Developer token is not allowed with project 45678901"
Issue :The client currently accesses API data for MCC Account 1234567 using a service account created in project XYZABC. However, since I belong to a different team with a distinct use case, I also need to extract data for MCC Account 1234567. The client has provided a Developer token for this purpose.

Unable to use project XYZABC, I have set up a new service account in project PQRSTUVW with domain-wide delegation and an impersonated email address. Despite using the Developer token shared by the client, I encountered an error when running a Python script to access the API: "Developer token is not allowed with project 45678901". Please refer to the attached snapshot for details.


Screenshot 2024-07-22 at 7.14.02 PM.png
Python script is below

credentials = {
        "developer_token": "87654321",
        "login_customer_id": "1234567",
        "version": "v17",
        "use_proto_plus": True,
        "scopes" : ['https://www.googleapis.com/auth/adwords'],
        "json_key_file_path":  "/Workspace/Users/abcd.com/1234567.json" ,
        "impersonated_email":  "ab...@mail.com"
    }

Queries are mentioned below
  • How can we resolve the issue without disrupting their pipeline and ensure our team can access API results?
  • Is it possible to generate a new developer token for MCC Account 1234567 and utilize it within our project PQRSTUVW?
  • Given that both projects, PQRSTUVW and XYZABC, belong to the same organization, could Google be blocking API access? (This question arises from information in forums and articles stating that only one developer token can be active per project at any given time.)
  • Are there any other permission required for the API to run smoothly.

Google Ads API Forum Advisor

unread,
Jul 25, 2024, 6:50:20 AM7/25/24
to anoop...@cimpress.com, adwor...@googlegroups.com
Hi,

Thank you for contacting the Google Ads API support team.

I could see in the provided screenshot that the error message says "Developer token is not allowed with the project". This means the developer token you are using in your request is not associated with the project that you are using in the same request.

Each Google API Console project can be associated with the developer token from only one manager account. Once you make a Google Ads API request, the developer token is permanently paired with that project. You can reset a developer token and use it with the project PQRSTUVW, let us know how it goes.

I could see that you are facing a PERMISSION DENIED error, which means that the user doesn't have permission to access a specific account. To assist you further, please provide us with an email address used to make API requests and complete API request and response logs with the request ID and request header where you encountered an error.

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that  you are using. You can refer to the guides Java.NetPHPPythonRuby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag. 

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.!5004Q02vE76U:ref" (ADR-00259477)

Thanks,

 
Google Logo Google Ads API Team

Register for the upcoming workshop: Performance Max and the Google Ads API!
 


Anoop Kumar

unread,
Jul 25, 2024, 9:39:10 AM7/25/24
to Google Ads API and AdWords API Forum
Hi Team,

Each Google API Console project can be associated with the developer token from only one manager account. Once you make a Google Ads API request, the developer token is permanently paired with that project. You can reset a developer token and use it with the project PQRSTUVW, let us know how it goes.
As you mentioned to reset the Developer token, by doing this does that effect the existing API pipelines in the other project XYZABC.  

Google Ads API Forum Advisor

unread,
Jul 25, 2024, 1:33:54 PM7/25/24
to anoop...@cimpress.com, adwor...@googlegroups.com
Hi,

As informed already, each Google API Console project can be associated with the developer token from only one manager account. So, once you reset the developer token and make the API call with project PQRSTUVW, you will not be able to make API calls to other project XYZABC anymore.

Hope this answers your query.If you have any more queries, please feel free to get back to us.

Anoop Kumar

unread,
Jul 29, 2024, 5:17:22 AM7/29/24
to Google Ads API and AdWords API Forum
Hi Team, 

Thanks for the information. Final query , is there any other alternative (apart from the above mentioned suggestion)  wherein it does not affect the existing pipeline in the client ends project and also we are also able to extract the data in our project. 

Google Ads API Forum Advisor

unread,
Jul 29, 2024, 11:18:02 AM7/29/24
to anoop...@cimpress.com, adwor...@googlegroups.com

Hi,

As we said earlier, once you make a Google Ads API request, the developer token is permanently paired with the Google API Console project. If you want to switch accounts, you'll need to create a new Google API Console project for Google Ads API requests that use the new manager's token. 

Anoop Kumar

unread,
Jul 31, 2024, 8:36:39 PM7/31/24
to Google Ads API and AdWords API Forum
Hi Team,

In case if I ask my client for the same credential's i.e service account and impersonation mail id and get required permission  that they are using, can I use those details in my GCP project to call the API?

Google Ads API Forum Advisor

unread,
Aug 1, 2024, 5:25:51 AM8/1/24
to anoop...@cimpress.com, adwor...@googlegroups.com
Hi,

If you have access to the client MCC account(manager account) and if you get all required credentials from your client then you can make API calls directly.

I don't understand this part, "can I use those details in my GCP project to call the API?" How will you use those credentials in your project? Could you please explain this.
Reply all
Reply to author
Forward
0 new messages