title: I want to get Stex.com API access token
body: <p>I am developing C# WinForms application to trade on Stex.com.
  They upgraded their api to api3.
  It uses google authentication app to login.
  That's why there's no way to get access token without man's behavior.
  Finally, I determined to use postman to get access token and I want to refresh token when the token is expired.</p>
  
  <p>I think it the best way.
  So I got the access token and refresh token via postman.
      <a href="https://help.stex.com/en/articles/2740368-how-to-connect-to-the-stex-api-v3-using-postman" rel="nofollow noreferrer">https://help.stex.com/en/articles/2740368-how-to-connect-to-the-stex-api-v3-using-postman</a> .</p>
  
  <p>now it's the turn to refresh my token.
  so this is what I wrote.</p>
  
  <pre><code>string refresh_token = "def50200b03974080...";
  string client_id = "502";
  string client_secret = "SeTs50aFxV1RoMFBW1b4RVNQhh2wEdICaYQrpE3s";
  string AccessToken = "eyJ0eXAiOiJKV1QiLCJhbGciO...";
  string url = @"https://api3.stex.com/oauth/token";
  var request = HttpWebRequest.Create(url);
              request.Method = "POST";
              request.Headers.Add("Authorization", "Bearer " + AccessToken);
              request.ContentType = "application/x-www-form-urlencoded";
   NameValueCollection outgoingQueryString = HttpUtility.ParseQueryString(String.Empty);
              outgoingQueryString.Add("grant_type", "refresh_token");
              outgoingQueryString.Add("refresh_token", refresh_token);
              outgoingQueryString.Add("client_id", client_id);
              outgoingQueryString.Add("client_secret", client_secret);
              outgoingQueryString.Add("scope", "trade profile reports");
              outgoingQueryString.Add("redirect_uri", @"https://www.getpostman.com/oauth2/callback");
  
  byte[] postBytes = new ASCIIEncoding().GetBytes(outgoingQueryString.ToString());
  
  Stream postStream = request.GetRequestStream();
              postStream.Write(postBytes, 0, postBytes.Length);
              postStream.Flush();
              postStream.Close();
  
  using (WebResponse response = request.GetResponse())
  {
      using (StreamReader streamReader = new StreamReader(response.GetResponseStream()))
      {
          dynamic jsonResponseText = streamReader.ReadToEnd();
       }
  }
  </code></pre>
  
  <p>It shows 401(Unauthorized) error.
  And when I remove ContentType, it shows 400(Bad Request) error.
  If anyone did this, please help me.</p>