I have this javascript api call
api.call("Get",{"typeName":"LogRecord",
"resultsLimit":10,
"search":{
"fromDate":new Date().toISOString()
}});
Now i need to call the same api using C# with same parameters. This is how my C# code looks like –
public async Task<List<LogRecord>> GetLogRecord(API api, ILogger log)
{
List<LogRecord> data = new List<LogRecord>();
try
{
api.Timeout = 3600000;
var type = "LogRecord";
Dictionary<string, object> parameters;
Dictionary<string, object> date1 = new Dictionary<string, object>{};
date1.Add("fromDate", new DateTime().ToString());
parameters = new Dictionary<string, object>{};
parameters.Add("typeName", type);
parameters.Add("resultsLimit", 10);
parameters.Add("search", date1);
data = await api.CallAsync<List<LogRecord>>("Get", typeof(LogRecord), parameters,default);
//{
// parameters
//});
}
catch (Exception ex)
{
log.LogInformation(ex.Message.ToString());
}
return data;
}
But i am getting an exception : “Error getting json response. HttpStatusCode: OK
What i am doing wrong i am not getting it. Please Help!