Skip to content

Instantly share code, notes, and snippets.

@pmalicki11
Last active January 20, 2026 15:48
Show Gist options
  • Select an option

  • Save pmalicki11/c87deac66b81e6252c931100a4fd0d46 to your computer and use it in GitHub Desktop.

Select an option

Save pmalicki11/c87deac66b81e6252c931100a4fd0d46 to your computer and use it in GitHub Desktop.
Classic UI Rest Call
// Add references
// 1. Newtonsoft.Json.dll
// 2. Epicor.Ice.Lib.RestClient
using Ice.Lib.RestClient;
using System.Net;
using System.Net.Http;
using Newtonsoft.Json.Linq;
private void CheckSomething()
{
IRestClient restClient = new RestClientBuilder().UseSession(oTrans.CoreSession).Build();
HttpResponseMessage response = restClient.Function.Post("Library", "Function", new RestContent(new {Input = "value"}));
if (response.StatusCode == HttpStatusCode.OK)
{
var jObject = response.GetJsonResult() ?? new JObject();
bool isActive = jObject.ContainsKey("IsActive") && jObject["IsActive"].Type == JTokenType.Boolean && (bool)jObject["IsActive"];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment