NEST API C# Unauthorized Error



I was recently playing with sending API Request to Nest Thermostat via Postman and everything works fine, but when i’m sending same request via c# code :

and i’m gettting this error


What am i doing wrong ?


Are you attempting to reuse the auth code more than once?
See "Key Point: Your authorization code is valid for one POST call."

Note that an auth code is different from an access token.
The former can be used once.
The latter can be used multiple times.

Also - need to handle redirects correctly. See

Hope these help