Hi,
I want to get company details, it gives me a message “User agent http header not set”.
Is there something like tenant id in freeagent api?
My code is as below.
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
var nclient = new HttpClient();
nclient.DefaultRequestHeaders.TryAddWithoutValidation(“Content-Type”, “application/x-www-form-urlencoded;”);
nclient.DefaultRequestHeaders.Add(“accept”, “application/json”);
nclient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue(“Bearer”, new_access_token);
var nreq = new HttpRequestMessage(HttpMethod.Get, “https://api.sandbox.freeagent.com/v2/company”);
var nres = await nclient.SendAsync(nreq);
string nrep = await nres.Content.ReadAsStringAsync();
Thanks