Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

OAUTH2 C# POST TD Ameritrade Getting error

$
0
0

 I am now attempting to use the refresh_token that is valid for 90 days to get an auth token.  I get an error "":\"Failed to resolve API Key variable request.header.un\"\n \t\t}\n" this is from my C# . I am sure my refresh_token is accurate.  Here is the code:

           string     url = string.Format("https://api.tdameritrade.com/v1/oauth2/token");
            RestClient client = new RestClient(url);
            RestRequest postRequest = new RestRequest(Method.POST);
            postRequest.AddHeader("cache-control", "no-cache");
            postRequest.AddHeader("content-type", "application/x-www-form-urlencoded");
            postRequest.AddParameter("application/x-www-form-urlencoded", "grant_type=refresh_token&    refresh_token=cNxNLQlM@AMER.OAUTHAP", ParameterType.RequestBody);//, ParameterType.RequestBody)

            

   //  This is where the post is executed
            IRestResponse response = client.Execute(postRequest);


Viewing all articles
Browse latest Browse all 4737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>