This service returns a list of all ledger keys and their associated type
using System.Net;
using Newtonsoft.Json.Linq;
public void MethodName(parms){
string uri = "https://fusion.superion.com/FusionOSServices/v0/ONESolution/IntelliTime/Keys";
using (WebClient wc = new WebClient())
{
wc.Headers.Add("Content-Type", "application/json");
// Replace "ID" with supplied AppID
wc.Headers.Set("X-APPID", "ID");
// Replace "KEY" with supplied AppKey
wc.Headers.Set("X-APPKEY", "KEY");
while (uri != null)
{
string result = wc.DownloadString(uri);
var response = JObject.Parse(result);
var keys = (JContainer)response["RequestResponse"]["DATA"]["KEYS"];
foreach (var key in keys )
{
// Your code goes here
}
// responses with more then 1000 keys are broken up into multiple requests
uri = (string)response["RequestResponse"]["NextUri"];
}
}
}
{
"RequestResponse": {
"Count": "2",
"DATA": {
"KEYS": [
{
"TYPE": "GL",
"LEDGER": "A7",
"KEY": "0000000000",
"MEDIUMDESC": "All Zeros",
"LONGDESC": "All Zeros",
"STATUS": "A",
"ACCEPTTRANSACTIONS": "Y",
"STARTDATE": "12/27/2017 12:00:00 AM",
"ENDDATE": ""
},
{
"TYPE": "GL",
"LEDGER": "GL",
"KEY": "0000012",
"MEDIUMDESC": "TestKey",
"LONGDESC": "TestKey",
"STATUS": "A",
"ACCEPTTRANSACTIONS": "Y",
"STARTDATE": "",
"ENDDATE": ""
}
]
}
}
}