search_term_view API + Developer Token Prohibited

147 views
Skip to first unread message

Madhu Puranik

unread,
Apr 10, 2023, 12:46:22 PM4/10/23
to Google Ads API and AdWords API Forum
Hi,

I'm trying to pull data from the search_term_view API. However, I get the below error

Error Message
[
    {
        "error": {
            "code": 403,
            "message": "The caller does not have permission",
            "status": "PERMISSION_DENIED",
            "details": [
                {
                    "@type": "type.googleapis.com/google.ads.googleads.v13.errors.GoogleAdsFailure",
                    "errors": [
                        {
                            "errorCode": {
                                "authorizationError": "DEVELOPER_TOKEN_PROHIBITED"
                            },
                            "message": "Developer token is not allowed with project '407408718192'."
                        }
                    ],
                    "requestId": "qkV_wbudvZGFvhT_TevrOQ"
                }
            ]
        }
    }
]

Here's the query I used:

{
"query": "SELECT campaign.name, campaign.id, campaign.status, customer.id, ad_group.id, ad_group.name, ad_group.status, metrics.all_conversions, metrics.clicks, metrics.conversions, metrics.cost_micros, metrics.ctr, metrics.interactions, metrics.impressions, metrics.cost_per_conversion, metrics.cost_per_all_conversions, metrics.all_conversions_value, metrics.absolute_top_impression_percentage, segments.date, search_term_view.search_term FROM search_term_view WHERE segments.date BETWEEN '2023-03-01' AND '2023-03-31'"
}

Can you please help resolve the issue?

Thanks,
Madhu




Google Ads API Forum Advisor

unread,
Apr 11, 2023, 8:22:44 AM4/11/23
to madhu....@revlitix.com, adwor...@googlegroups.com
Hi Madhu,

you're getting DEVELOPER_TOKEN_PROHIBITED error (https://developers.google.com/google-ads/api/docs/best-practices/common-errors?hl=en#authorizationerror) . This error is one of the AuthorizationError which usually it occurs when the developer token is not allowed with the project sent in the request. 

As per this document (https://developers.google.com/google-ads/api/docs/first-call/dev-token), 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 to the Google API Console project. If switching to a developer token under a new manager account you'll need to create a new Google API console project (https://developers.google.com/google-ads/api/docs/first-call/oauth-cloud-project) for Google Ads API requests that use the new manager's token. If you do not use a new Google API Console project, you'll get a DEVELOPER_TOKEN_PROHIBITED error when making a request.

Let me know if you have further questions.

Regards,
Google Logo Google Ads API Team


ref:_00D1U1174p._5004Q2kTngy:ref

Madhu Puranik

unread,
Apr 11, 2023, 8:32:13 AM4/11/23
to Google Ads API Forum Advisor, adwor...@googlegroups.com
Thanks for your email.

How do I check which developer token I need to use to make the request? Can you please help me with that?

Thanks,
Madhu

Google Ads API Forum Advisor

unread,
Apr 11, 2023, 2:33:39 PM4/11/23
to madhu....@revlitix.com, adwor...@googlegroups.com

Hi Madhu,

Thanks for getting back to us.



How do I check which developer token I need to use to make the request? Can you please help me with that?

>> Unfortunately, we can not check this on our end. However, can you confirm if you have just recently switched developer token under a new manager account? 

If yes, as we have previously mentioned in our email, As per this document (https://developers.google.com/google-ads/api/docs/first-call/dev-token), each Google API Console project can be associated with the developer token from only one manager account. 

If switching to a developer token under a new manager account, you'll need to create a new Google API Console project for Google Ads API requests that use the new manager's token. Can you confirm if this is possible on your end? If creating a new project is not possible, can you please provide the Manager account that contains the developer token, and the Google Cloud project number (e.g. 354025419297)? Also, note that that this change requires a manual database update, and could take a few days to complete.

You can provide it via the Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Let us know how it goes.

Reference links included in this email:

Reply all
Reply to author
Forward
0 new messages