Odd api error message after client upgrade

63 views
Skip to first unread message

Mike Diehl

unread,
Apr 4, 2018, 12:16:50 PM4/4/18
to AdWords API Forum
Hi all,

I just upgraded our AdWords Perl client after receiving an error message that my version had been sunsetted.

Now, I'm receiving another error message:

{
 "error": "invalid_token",
 "error_description": "Invalid Value"
}

However, I still get data from the server and the received data looks rational.

I just want the error message to go away, or fix whatever problem it indicates.

The call that causes the error message is:

Google::Ads::Common::ReportUtils::get_report_handler($report_definition, $client);

Note, that I didn't change ANY of our code and it was working without errors yesterday.

Any ideas?

Mike.

Dhanya Sundararaju (AdWords API Team)

unread,
Apr 4, 2018, 3:30:56 PM4/4/18
to AdWords API Forum
Hi Mike,

Your access token may be getting invalid after expiry time. You can check if thats the case by providing your access token in the Google API Explorer and checking the 'expires_in' field.

Also, if you are setting access token in your script as in below code snippet, could you please retry after commenting out the same?
$client->get_oauth_2_handler()->set_access_token('...'); 

If you still get the invalid_token error, could you please reply back with complete error message?

Regards,
Dhanya, AdWords API Team

Mike Diehl

unread,
Apr 6, 2018, 10:52:59 AM4/6/18
to AdWords API Forum
Hi,

Thanks for getting back to me.

Unfortunately, I don't have a line in my (previously working) code that resembles the $client->get_oauth_2_handler()->set_access_token('...');  line you indicated.

But, I was able to comment out the oAuth2AccessToken line in ~/adwords.properties and the error went away.  I'm presuming these are equivalent values, just set with different methods.

So, I think this one is fixed.

Thanks again,

Mike.


Dhanya Sundararaju (AdWords API Team)

unread,
Apr 6, 2018, 2:08:20 PM4/6/18
to AdWords API Forum
Hi Mike,

Yes, that should do. Thanks for updating.
Reply all
Reply to author
Forward
0 new messages