Posts tagged with restsharp

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." } 

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

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?

I am currently trying to integrate single Google Ads account for my client using RestSharp in C# (don't want to use client libraries). I have found the useful link to generate access token by providing client ID , Client secret and Refresh token.

https://developers.google.com/google-ads/api/docs/rest/auth

I am now trying to test on Postman first before I start developing code in C# but failing to get access token. The screen shot below shows the call I am doing to get access token using Post man.

I also tried CURL in postman which was mentioned in the link above but getting the same error.

FYI it is a Desktop app chosen in google console to generate client ID and secrete because I will be creating console app to integrate Google Ads API.