Hi, we're trying to get all requests based on certain criteria via the V3 API web services. I can successfully query it using PostMan but not C#. PostMan allows to export code for various languages, including RestSharp which uses C# and .NET. I've also tried other methods like cURL which works fine also. The code is below. If we omit the input_data it works okay (but brings back everything). And the error indicates that. Any help would be appreciated.
Thanks
Daniel
{"response_status":{"status_code":4000,"messages":[{"status_code":4001,"field":"input_data","type":"failed","message":"Unable to parse the JSON"}],"status":"failed"}}
- var client = new RestClient("http://sdserver:8080/api/v3/requests");
- client.Timeout = -1;
- var request = new RestRequest(Method.GET);
- request.AddHeader("TECHNICIAN_KEY", "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX");
- request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
- request.AddParameter("input_data", "{\"list_info\":{\"search_criteria\":[field:created_time,values:[\"1568777400000\",\"1568795400000\"],logical_operator:between]}}");
- IRestResponse response = client.Execute(request);
- Console.WriteLine(response.Content);