Example #1
0
        public TokenResponse ExchangeToken(string publicToken)
        {
            var request = new RestRequest("/exchange_token", Method.POST);

            request.Parameters.Add(new Parameter
            {
                Name  = "client_id",
                Value = _clientId
            });
            request.Parameters.Add(new Parameter
            {
                Name  = "secret",
                Value = _secret
            });
            request.Parameters.Add(new Parameter
            {
                Name  = "public_token",
                Value = publicToken
            });

            var response       = Client.Execute(request);
            var responseObject = new TokenResponse(response);

            SetAccessToken(responseObject.GetAccessTokenObject().AccessToken);

            return(responseObject);
        }