API Toekn is not working

97 views
Skip to first unread message

Grupo Gera

unread,
Feb 9, 2022, 4:42:15 PM2/9/22
to Google Ads API and AdWords API Forum
Hello, 

I followed the steps to use that script called get_campaigns.py and the following error occurred:

Request made: ClientCustomerId: 6228911701, Host: googleads.googleapis.com, Method: /google.ads.googleads.v9.services.GoogleAdsService/SearchStream, RequestId: "bla bla", IsFault: True, FaultMessage: The developer token is not approved. Non-approved developer tokens can only be used with test accounts.
Request with ID "bla bla" failed with status "PERMISSION_DENIED" and includes the following errors:
        Error with message "The developer token is not approved. Non-approved developer tokens can only be used with test accounts.".

I consulted my token and there is nothing telling that it is not approved.  What should I do?

Google Ads API Forum Advisor

unread,
Feb 10, 2022, 12:30:01 PM2/10/22
to grupog...@gmail.com, adwor...@googlegroups.com
Hi Gera,

Thank you for reaching out to the Google Ads API support team.

Since you have encountered the PERMISSION_DENIED error, please ensure that the user email used to create the OAuth credentials also has the appropriate access for the Ads account that you are targeting. That said, kindly double check if your OAuth2 credentials are correct for the said user. If you still encounter an error, you may provide us with the  email address you used to generate the OAuth2 credentials, and complete request and response logs with the request-id generated, so our team can better check.

For the Python library, logging can be enabled by navigating to the Client libraries > Your client library (select Python) > Logging documentation, which you can access from this link. You may then send the requested information via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Thanks,
Google Logo
Nirmita
Google Ads API Team
 

 

ref:_00D1U1174p._5004Q2W5tHQ:ref
Message has been deleted

Google Ads API Forum Advisor

unread,
Feb 15, 2022, 12:33:20 PM2/15/22
to grupog...@gmail.com, adwor...@googlegroups.com
Hi,


Thank you for reaching out to the Google Ads API support team.

With regards to your concern, you’ve encountered ‘USER_PERMISSION_DENIED' error. The ‘USER_PERMISSION_DENIED’ usually occurs due to incorrectly setting the 'login-customer-id’ in the request or not specifying login-customer-id in the request. Note that when a user doesn't have permission to access a customer and you’re accessing a client customer then the manager's customer ID must be set in the 'login-customer-id’ in the header request.

To resolve this, you will need to ensure that your OAuth2 credentials were generated while logged in as the user / email address that has access to the customer ID in your request. Also, if the said user / email address is one that has access to the MCC / manager of the customer account, then you may specify the MCC / manager account's ID as the login-customer-id.

Furthermore, note that you received the "The developer token is not approved. Non-approved developer tokens can only be used with test accounts" error message when you tried to access the production accounts with the test developer access. It is intended to get the error DEVELOPER_TOKEN_NOT_APPROVED, since you would need to request for at least a basic access level for developer token if you would be making calls to your production Google Ads accounts, by filling up and submitting this application form.

Let me know if you have any question.
Reply all
Reply to author
Forward
0 new messages