Is there a rest endpoint for listing Epicor Functions?

The Epicor rest documentation states that this is the endpoint for listing the function libraries in the system : https://serverurl/api/v2/efx/{Company}

However there is no mention of how to get a list of the actual functions inside the libraries themselves. Does anyone know of an endpoint for this? Thanks.

I’ve only seen a Custom Endpoint:

https://{server}/{instance}/api/help/v2/methods/Ice.LIB.EfxLibraryDesignerSvc/index

1 Like

The rest help page lists them

2 Likes

Hi Jose, could you elaborate? Are you saying there’s an endpoint listed in the rest help page or that the rest help page simply lists them? I’m trying to automate a process to call an endpoint and then list all the functions in the environment so I’m looking for it to be an actual endpoint I can call via script externally if it does exist. Thanks.

The service endpoint I posted above is the help page. You will find a GetLibraryList and GetFunctionList call.

Hi Mark, I’m a little unfamiliar with these particular custom methods. GetFunctionList for example seems to be a post with a default payload of:

    {
  "options": {
    "kind": 0,
    "libraryID": "string",
    "functionIDStartsWith": "string"
  }
}

If I execute this with the default string above it obviously returns nothing:
image

What am I supposed to be using as a payload to return these functions?

Custom functions match exactly to the Epicor Business Objects. You will see the very same calls if you do a trace.

Start with something easy. Try GetLibraryList using this for an input:

{
  "options": {
    "kind": 0,
    "startsWith": "",
    "rollOutMode": 0
  }
}

That will give you a list of your Epicor Function Libraries. To get the list of functions within a library, then you would call GetFunctionList:

{
  "options": {
    "kind": 0,
    "libraryID": "{One of your Library IDs from above}",
    "functionIDStartsWith": ""
  }
}

Finally, use GetFunctionInfo to return the signature information about that function:

{
  "options": {
    "libraryId": "{One of your Library IDs from above}",
    "kind": 0,
    "functionId": "{A Function Name from above}"
  }
}
5 Likes

Thanks Mark, this is really helpful.

1 Like

Ice.LIB.EfxLibraryDesignerSvc service is not a part of Epicor/Kinetic public API. It can be changed or even removed without any public notifications.

1 Like

Makes sense. Given how easy it is to setup and maintain Epicor Functions, it really doesn’t make much sense anymore to develop integrations calling the standard REST API most of the time anyway. From security, maintenance, and efficiency/performance perspectives, leveraging the Epicor Functions framework to create easily publishable, maintainable, and testable functions just makes far more sense.

1 Like

Just as an alternative to @Mark_Wonsil’s valid solution and as an FYI: Below is an example of an Epicor Function to return a list of Epicor Functions that can be used as a starting point.

By leveraging an Epicor Function to return a consolidated list of Functions, it will generally allow a far simpler integration in terms of external code/logic and be far more performant/efficient due to a lot less overhead while also making the broader solution easier to troubleshoot/support/update in the case of potential standard API/service changes in future updates.



var efxFunctionSearchTS = outputDs; //new Ice.Tablesets.EfxFunctionSearchTableset();
var efxFunctionSearchTempTS = new Ice.Tablesets.EfxFunctionSearchTableset();

// Get Library List
this.CallService<Ice.Contracts.EfxLibraryDesignerSvcContract>(efxSvc =>
{
var efxLibrarySeachOptions = new Ice.Lib.EfxLibraryDesigner.LibrarySearchOptions(“”,Ice.Lib.EfxLibraryDesigner.SearchKind.Usage,Ice.Lib.EfxLibraryDesigner.RollOutMode.Any);
Ice.Tablesets.EfxLibrarySearchTableset librariesDs = efxSvc.GetLibraryList(efxLibrarySeachOptions);

// For each Library, get Functions and merge results to a single return TS
foreach(var item in librariesDs.EfxLibraryList)
{
// Get Functions
var seachOptions = new Ice.Lib.EfxLibraryDesigner.FunctionSearchOptions(item.LibraryID,Ice.Lib.EfxLibraryDesigner.SearchKind.Usage);
efxFunctionSearchTempTS = efxSvc.GetFunctionList(seachOptions);

foreach(var efxFunctionListRow in efxFunctionSearchTempTS.EfxFunctionList)
{
  var newEfxFunctionListRow = new EfxFunctionListRow();
  BufferCopy.CopyExceptFor(efxFunctionListRow, newEfxFunctionListRow);
  efxFunctionSearchTS.EfxFunctionList.Add(newEfxFunctionListRow);
}

}
});

1 Like

To get list of libraries available for a company you can use get request to the following url

https://[server]/[erp-app]/api/v2/efx?api-key=[api-key]

The library definition (methods and their signatures) are available via Swagger/OpenAPI.
REST Help works based on such endpoints.

2 Likes

This is the solution for querying REST endpoints, Epicor or otherwise.

2 Likes