# EMUG 2/21/2025 - REST and Functions Notes and Resources

**URL:** <https://www.epiusers.help/t/emug-2-21-2025-rest-and-functions-notes-and-resources/123450>\
**Category:** Kinetic ERP\
**Tags:** rest\
**Created:** [February 21, 2025, 7:20pm UTC](https://www.epiusers.help/t/emug-2-21-2025-rest-and-functions-notes-and-resources/123450 "2025-02-21T19:20:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![josecgomez](https://www.epiusers.help/user_avatar/www.epiusers.help/josecgomez/32/55731_2.png) [@josecgomez](https://www.epiusers.help/u/josecgomez)\
**Post date:** [February 21, 2025, 7:20pm UTC](https://www.epiusers.help/t/emug-2-21-2025-rest-and-functions-notes-and-resources/123450/1 "2025-02-21T19:20:22Z")

</div>

Power Point Slides:  
[Epicor REST and Functions.pptx](https://www.epiusers.help/uploads/short-url/qS9viENJG7iqLd73ZAiKLGmFUNf.pptx) (3.4 MB)

Here are some of the resources and examples covered in the EMUG meeting for 2/21/2025 on the topic of REST and Epicor Functions.

## Tools

| Tool | URL | Purpose |
| --- | --- | --- |
| Postman | [https://www.postman.com/](https://www.postman.com/) | Free (as in beer) tool to exercise HTTP Verbs |
| Classic Trace Helper | [Trace Helper Utility for Epicor ERP 10](https://www.epiusers.help/t/trace-helper-utility-for-epicor-erp-10/58018) | Utility to help you read / parse traces done in classic client |
| Kinetic Web Trace Utility | [Kinetic Trace Helper Utility 1.0 (Kinetic Web) Chrome Extension](https://www.epiusers.help/t/kinetic-trace-helper-utility-1-0-kinetic-web-chrome-extension/108390) | Chrome Extension to help you trace Epicor on the Web |
| REST Nuget Library | [Epicor Rest Helper (Nuget) Updated V3](https://www.epiusers.help/t/epicor-rest-helper-nuget-updated-v3/76250) | C# Library to make calling and interacting with Epicor REST a breeze |
| NMP Node Rest Library | [Epicor Rest Helper for Node (npm) V2.0](https://www.epiusers.help/t/epicor-rest-helper-for-node-npm-v1/76670) | Node Library to make interacting with Epicor Rest a breeze from Node |
| Angular Rest Library | [Epicor Rest Helper for Angular (NPM ) V1](https://www.epiusers.help/t/epicor-rest-helper-for-angular-npm-v1/76431) | Angular Library to make working with Epicor Rest and Angular easy |
| Excel with Params REST | [Pull REST data into Excel based on values on excel? - #24 by amurdock](https://www.epiusers.help/t/pull-rest-data-into-excel-based-on-values-on-excel/55702/24) | Amazing Excel tool by @amurdock which allows you to run REST BAQs directly from Excel while passing in dynamic parameters and filters. |

## Examples

### C# Example for Calling an Epicor BAQ

```auto
using EpicorRestAPI;

EpicorRest restClient = new EpicorRest();
restClient.AppPoolHost = "your.epicor.server";
restClient.AppPoolInstance = "YourEpicorInstance";
restClient.UserName = "epicor"; //username for epicor
restClient.Password = "epicor"; //password for epicor
restClient.Company = "EPIC06"; //Your Company ID
restClient.CallSettings = new CallSettings("EPIC06", "MfgSys", "eng-us", "");
restClient.APIKey = "YourEpicorApiKeyGoesHere";

var baqResult =restClient.BaqGet("zCustomer01");

if(!baqResult.IsErrorResponse)
{
    Console.WriteLine(baqResult.ResponseBody);
}

```

### Node Example

Calling a BAQ and spinning a web server that will execute ANY BAQ passed in to the URL as

```auto
localhost:3000/baq/<baqID>

```

```auto
import { EpicorRestService } from "epicor-rest-node";
import express from 'express';

let EpicorRestApi = new EpicorRestService();
EpicorRestApi.AppPoolHost = "Your.Epicor.Server";
EpicorRestApi.AppPoolInstance ="EpicorInstance";
EpicorRestApi.APIKey="YourEpicorKeyGoesHere";
EpicorRestApi.UserName="epicor"; //Your Epicor Username
EpicorRestApi.Password="epicor"// Your Epicor Password
EpicorRestApi.Company="EDU06"; //Your Epicor Company ID

//Execute BAQ and print the results
EpicorRestApi.BaqGet('zCustomer01')?.then((data:any) => {
    console.log(JSON.stringify(data.data, null, 2));
}).catch((error) => {
    console.log(error);
});

// Spin an Express Server and respond to any dynamic BAQ
const app = express();
const port = 3000;

app.get('/baq/:myBaq', async (req, res) => {
    const myBaq = req.params.myBaq;
    try {
        const data = await EpicorRestApi.BaqGet(myBaq);
        res.json(data?.data);
    } catch (error:any) {
        res.status(500).send(error?.message);
    }
});

app.listen(port, () => {
    console.log(`Server is running at http://localhost:${port}`);
});

```

### Calling REST from a Classic Customization

You need to bring in these helper DLLs

 ![image](https://www.epiusers.help/uploads/default/original/3X/d/9/d95b209e60085e0967e753705b50042647658380.png)

Execute a Function in the Client using Rest Helper

```auto
var _restClient = new RestClientBuilder().UseSession(oTrans.CoreSession).Build();
		var functionContent = new RestContent(new { iPhrase = "hey There" });
		var functionResponse = _restClient.Function.Post("FunFunction", "MyHelloFunction", functionContent, published: false);
		var functionResult = functionResponse.GetAnonymousResult(new { oSuccess = false, oMessage = "" });

		if(!functionResult.oSuccess)
		{
			MessageBox.Show(functionResult.oMessage);
		}

```

---

<div class="post-metadata">

**Author:** ![kve](https://www.epiusers.help/user_avatar/www.epiusers.help/kve/32/76150_2.png) [@kve](https://www.epiusers.help/u/kve)\
**Post date:** [February 21, 2025, 9:34pm UTC](https://www.epiusers.help/t/emug-2-21-2025-rest-and-functions-notes-and-resources/123450/2 "2025-02-21T21:34:19Z")

</div>

Great presentation today, Jose!

---

<div class="post-metadata">

**Author:** ![josecgomez](https://www.epiusers.help/user_avatar/www.epiusers.help/josecgomez/32/55731_2.png) [@josecgomez](https://www.epiusers.help/u/josecgomez)\
**Post date:** [February 21, 2025, 9:35pm UTC](https://www.epiusers.help/t/emug-2-21-2025-rest-and-functions-notes-and-resources/123450/3 "2025-02-21T21:35:41Z")

</div>

Thanks Kevin  
Rushed! too much content for 55 minutes

---

<div class="post-metadata">

**Author:** ![Hally](https://www.epiusers.help/user_avatar/www.epiusers.help/hally/32/1263_2.png) [@Hally](https://www.epiusers.help/u/Hally)\
**Post date:** [February 22, 2025, 4:44am UTC](https://www.epiusers.help/t/emug-2-21-2025-rest-and-functions-notes-and-resources/123450/4 "2025-02-22T04:44:50Z")

</div>

Damn, missed it… hoping the vid pops up somewhere 🙂 As always thanks for spending the time to put this stuff together Jose.

🍺

---

<div class="post-metadata">

**Author:** ![kve](https://www.epiusers.help/user_avatar/www.epiusers.help/kve/32/76150_2.png) [@kve](https://www.epiusers.help/u/kve)\
**Post date:** [February 22, 2025, 5:08am UTC](https://www.epiusers.help/t/emug-2-21-2025-rest-and-functions-notes-and-resources/123450/5 "2025-02-22T05:08:15Z")

</div>

It will be up on CodaBears YouTube channel by next week.
