INVALID_TOKEN_HEADER in Adwords API

30 views
Skip to first unread message

Rokad Naina

unread,
Jun 16, 2021, 1:08:04 AM6/16/21
to AdWords API and Google Ads API Forum
Hello,

I have create new account  in my adwords dashboard.  I created the adwords client object using the correct, client_id, client_secret and refresh_token.

In my old account('TEST') i can create campaign and ads successfully but now i have change account and use the developer token which is found in the Account Settings -> AdWords API Center -> Developer token and modify the configuration file accordingly.

When i run the file for campaign create(PHP) it will retrieve error like INVALID_TOKEN_HEADER.

Can you please help here to fix issue ASAP.

Thank you in advance 
Naina Rokad

Google Ads API Forum Advisor

unread,
Jun 16, 2021, 11:19:08 PM6/16/21
to rokad8...@gmail.com, adwor...@googlegroups.com

Hello Naina,

Could you confirm if your developer token is new? If yes, then as per this guide, AdWords API is no longer available for new users. Sign up for the Google Ads API instead.

If not, then the INVALID_TOKEN_HEADER error signifies that the developer token in the request is missing or invalid. Common causes for this are stated below:

  • The developer token is not set on the request or it contains a typo.
  • The namespace of the headers in the request is not correct.

As for its remediation, could you try the following below?

  • Ensure that a developer token has been set and matches the value in the AdWords API Center.
  • Ensure that the headers of the request are in the namespace https://adwords.google.com/api/adwords/cm/{version}, where {version} is replaced with the version of the API being used.

If the issue persists, please share with us the complete SOAP logs (request and response with requestId) via Reply privately to author option or via this email address(googleadsa...@google.com).

Regards,

Google Logo
Mark Kevin Albios
Google Ads API Team
 


ref:_00D1U1174p._5004Q2Iw5gW:ref
Reply all
Reply to author
Forward
0 new messages