Hi,
I am requesting access token using c# language, my code and received json is as below. please check and update me regarding the same.
Code
var nvc = new List<KeyValuePair<string, string>>();
nvc.Add(new KeyValuePair<string, string>(“grant_type”, “authorization_code”));
nvc.Add(new KeyValuePair<string, string>(“code”, received_code));
nvc.Add(new KeyValuePair<string, string>(“redirect_uri”, sitepath + “sxclient/connect_fa.aspx”));
var client = new HttpClient();
client.DefaultRequestHeaders.TryAddWithoutValidation(“Content-Type”, “application/json”);
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue(“Basic”, utils.Base64Encode(app_client_id + “:” + app_client_secret));
var req = new HttpRequestMessage(HttpMethod.Post, “https://api.sandbox.freeagent.com/v2/token_endpoint”) { Content = new FormUrlEncodedContent(nvc) };
var res = client.SendAsync(req);
Response
Id = 11975, Status = WaitingForActivation, Method = “{null}”, Result = “{Not yet computed}”
AsyncState: null
CancellationPending: false
CreationOptions: None
Exception: null
Id: 11975
Result: null
Status: WaitingForActivation