令牌已过期或已撤消-Google Ads [英] Token has expired or revoked - Google Ads

查看:95
本文介绍了令牌已过期或已撤消-Google Ads的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用rest方法将Google Ads API集成到C#中.一切似乎都正常,但突然我开始收到400条错误消息的响应.

Hi I have been using rest methods to integrate Google Ads API in C#. Everything seemed to be working fine but all of sudden I started getting 400 response with the error message.

{
    "error": "invalid_grant",
    "error_description": "Token has been expired or revoked."
}

如上所述,我不是在使用客户端库,而是在使用restsharp并使用邮递员测试所有端点.

As mentioned above that I am not using client library but instead using restsharp and testing all my end points using postman also.

它为什么会发生?我的刷新令牌也有效.我已经用了一个星期了.我还没有达到刷新令牌的限制,因为在尝试设置帐户时,我只生成了3到4次刷新令牌.

Any reason why it is happening? My refresh token is also valid. I have been using this for one week. I have also not reached to the limit of refresh token as I have only generated refresh token 3 to 4 times when I was trying to set up the accounts.

我相信刷新令牌的有效期很长,然后为什么会发生呢?

I believe the validity of refresh token is life long then why it is happening?

推荐答案

我通过使用Playground生成新的刷新令牌解决了该问题.之所以过期,是因为我的项目的OAuth同意屏幕的发布状态处于测试模式.

I solved the problem by generating new refresh token using playground. The reason it expired because the publishing status of OAuth consent screen of my project was on testing mode.

如果要集成API,则需要为生产应用发布状态,以避免刷新令牌过期时手动生成刷新令牌.

If you are integrating an API, you need to apply publishing status for production to avoid manual generation of refresh tokens when it expires.

这篇关于令牌已过期或已撤消-Google Ads的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆