Oauth authorize API

I am trying to call https://squareupsandbox.com/oauth2/authorize passing my client id which works fine if I test it in browser. but when I am trying to run it ( same URL) through code using restTemplate.exchange methods, it is giving me bad request 400. any suggestions?

Looking at the errors in your logs it looks like the code is either already used our it has expired. :slightly_smiling_face: