# REST Overview Novel
**Category:** [Experts' Corner](https://www.epiusers.help/c/experts-corner/12)
**Created:** 2016-11-12 19:48 UTC
**Views:** 60871
**Replies:** 141
**URL:** https://www.epiusers.help/t/rest-overview-novel/36260
---
## Post #1 by @Bart_Elia
My apologies if you are confused about the REST services so let me try to fix that by giving you a fly over. It's pretty long and many Geek areas dropped into. If you want something written for normal human being and not geeks, please check out the documentation in the online help. I spent significant time having geek to normal translation done.
The new REST ‘wrappers’ have all the features of the existing web services. GetByID, GetRows, GetList, Update and all those custom methods on every service are all there with full abilities.
The difference is a different technology than the WCF endpoints where people are used to going into Visual Studio and clicking on ‘Add Web Reference’ and sucking in SOAP. That’s all still there, has full love and still worked on – evidence is all the new bindings people see lighting up all over for the various HTTP bindings including full F5 support. Nothing removed. Instead this is a recognition that one size does not fit all.
**_So why the heck did you add these?_**
The reality of technology today is everyone wants to unlock their data and get it where they want it. If you can only put functionality on a green screen in front of people today, a large majority wouldn’t be happy. They need their data in a browser remote anywhere, a phone, in Excel or some data analytics tool Epicor has never heard of. Also, you don’t want to pay a gazillion dollars to us for the client tool. In fact, most don’t want a tool at all. They want to point Excel at some Epicor server and get data without installing anything. If some JavaScript guru in your company wants to throw together some cool form for a browser mashup for their group or a little phone app, they don’t want a rigid path to freeing the data from an Epicor Server. Also, this whole Internet of Things and sensors all over the place don’t always have a full version of Windows running on them needed to push data into Epicor. All these use cases come back to needing a simple means to access / submit data in Enterprise Systems that SOAP promised long ago by bridging the gaps between competing technologies. That where the new REST services come in…
REST at its core is simply a URL. You call www.bing.com and you get back an html page and some pretty pictures in a format to show in a browser. You call http://www.bing.com/search?q=Epicor and you get back an html page about Epicor. You just did a ‘SQL Query’ of sorts but using a URL. We have done the same thing for all the ERP 10 services.
You want to get records from the SalesOrder service? Once REST is enabled in Admin Console and IIS, pop this into your browser:
https://YourServer/YourShare/api/v1/Erp.BO.SalesOrderSvc/SalesOrders
You get a login prompt for your Epicor credentials (e.g. – manager / manager).
Ok that and voila you get back a ‘GetRows’ of a bunch of data in some goofy format no human wants to read. (Ok, I like reading it but I’m a geek not a normal human being…)
**_Wait, what’s this goofy data, where is my where clause, I thought going at the database with a query by passes calculations and security! how the heck am I supposed to find anything…_**
First, the security aspect. Even though this is similar to querying a table (or tables) in the database, this is actually querying the public services we have been using for years. If you have column filtering, a calculation in a BPM or anything else, that all appears in the REST endpoints – even your UD fields.
Next, let’s pull apart that URL to start trying to understand how this is put together.
https://YourServer/YourShare/api/v1/Erp.BO.SalesOrderSvc/SalesOrders
_https://YourServer/YourShare_
The root is the same as you are used to pointing at. It’s wherever your IIS server is serving up the server or wherever the SaaS Ops team told you to select during install.
_/api_
**Wait, what’s that? Usually there is ERP for the product, ICE for the system?**
Well that’s the new home for all the REST toys we are talking about.
_/v1_
This is our new versioning mechanism. We recognize we will have to change this technology someday. That’s technology. I still miss my VT100 against a VAX but it’s hard to fit that in my Android phone. Things change so we assume at some point we will have to as well. When we do improve things and version, we need to preserve the current signatures so integrations you do from your IoT Refrigerator into ERP keep running.
_/Erp.BO.SalesOrderSvc_
**_Ok, something that finally looks somewhat familiar. Under the ERP / BO folder there is a file named SalesOrder.svc, right?_**
Yup gold star. We use the same organization in REST as you have been doing in v10 for some time.
_/SalesOrders_
**_SalesOrders. I already said SalesOrders so why am I repeating myself??_**
Well you drilled down into the SalesOrder Service but now you need to ask for what you want once you got there. OrderDel? OrderRel? In this case we asked for SalesOrders. These are all ‘Resources’ of the Service.
Another example might be:
<…>/FordSvc/F150
Ford provides an F150. SalesOrderSvc provides Sales Orders.
**_Now let’s get back to that goofy return value. What’s with that??_**
The format is called json (pronounced Jason). It’s extremely terse. No pretty xml element names to give you a hint about what it is. All that knowledge is kept outside the payload and you have to ask for help instead of having it forced on you when asking for data. That makes this format very small and perfect for going across the internet and slow cell phone networks. It’s also the native format in JavaScript to light up on a web page in a browser or on a phone. Those technologies no longer have to parse through a large slug of data returned to show on the screen. Got json? Slap to screen, done.
**_But I like my xml for interop? It’s self-describing!_**
_**Where was the where clause? I need to search on the customer!**_
_**Where am I going to find anything about any of this? Do I have to read some huge dev doc??**_
Let’s sneak up on all these by first not ignoring all the doc effort put into the standard docs. We have some excellent info on this in the online help so please browse over to your help site and drill down into System Management -> Working with System Management for the REST Implementation section. This has all the setup and background that you would need and some good examples.
But if you are like me… who reads the manual?
Instead let’s look back at the URL again
https://YourServer/YourShare/api /v1/Erp.BO.SalesOrderSvc/SalesOrders
Remember I said api had all the toys here? What about help?
https://YourServer/YourShare/api/help
The REST services are their own documentation. Want to see what services are available? Click on the Service List and search for the one you are interested in. (Yea, we have something like 1600 services so added a search box there for you, try it out).
Also if you have spent a week building up that perfect shape of data in a BAQ, have no fear, it’s there. Start typing its name and you’ll see it appear to select it.
Once you find your service or BAQ of interest then you move onto the help page for that resource. Let’s look at SalesOrderSvc for a reference-
**_Whoa, swagger? GET / POST / DELETE / PATCH?_**
Let’s get some background. Swagger is a formatting standard to doc REST services. It’s one of the gazillion bouncing around these days with all the cool kids doing internet enabling refrigerators and IoT devices monitoring their dogs eating habits. Luckily it is actually really nicely done and helpful as heck. So we decided to leverage it. Microsoft Azure did also so we feel pretty good about using the same approach.
Get / Post / Delete / Patch is the http version of the Epicor core methods of GetRows, GetByID, Update, Delete, etc. These are standard verbs for HTTP and allows the Epicor REST services to play nice with other internet technologies. It makes getting the data in and out of ERP 10 easier with a variety of modern internet tools. This is not to say we don’t have the Core methods anymore though! If you look at the top of the page you will see ‘Custom Methods’. This flips the docs over to look at the entire list of service methods you are used to seeing in a client customization or in Visual Studio Add web reference:
Let’s go back to the oData list and take a look at the $metadata resource. This is a standard ‘method’ on all services that list all the resources available for the service and the shape of the data going in and out of the service:
This is kind of a combination of a database ERD and an API reference all in one. It lets you know what is needed or available and a start to providing much richer documentation.
Now let’s drill into that original SalesOrder resource:
There are a couple of sections here. The upper section is the Model and Model Schema. The Model Schema is the shape of the data and some sample data as shown above.
The Model itself has a ton of information on the actual table and its columns:
And this Resource has a few parameters it can recieve to start doing a ‘where clause’ of sorts.
These parameters and a bunch more are part of an open standard called oData (www.oData.org). A bunch of tools speak this language already – Excel, PowerBI, Tableau, LINQPad, probably a few dozens more I have no clue about. They send the ‘SQL Queries’ / ‘Where clauses’ in this format. You can leverage the tools and point them at the REST service or go learn the language at oData org, it’s YOUR CHOICE.
Let’s try a couple of simple examples.
First, that json format is great for browsers but rough on integrations. To get the xml you are used to seeing you need to simply ask for it:
https://localhost/erp10/api/v1/Erp.Bo.SalesOrderSvc/SalesOrders/?$format=atom
We are starting to dig into the syntax of the ‘query string’. We start with a ‘?’ to tell the server I have a request on that resource. Then you tell it to give it to you in ‘atom’ format. This is a web standard for xml (https://en.wikipedia.org/wiki/Atom_(standard)). If anyone remembers RSS newsfeeds, this is an enhanced version and plays great with data analytics tools like Excel and PowerBI.
What this means is as a consumer of the REST services, you can ask the server how you want the data shaped. You don’t have to do that in your client. We are trying to allow for flexibility in what you want and not force you to do the shaping of the data in the client.
Next, let’s think about how a normal flow in using a form. You go to the form –
* Open Sales Order
* Search and get a list of Sales Orders - Sales Order service - GetList is called
* Select one (or more) Sales Order service – GetById (or GetRows) is called
* Make a change and save Sales Order service – Update is called
Obviously grossly simplified but this is an intro ;)
In the REST world, we are using standard HTTP verbs. GET is the verb for any query. Just like we had to ask for xml, you need to ask for one or more and in what shape explicitly. GetList is similar to a view in SQL server. No child tables, just an extremely lightweight and fast way to query against a flattened version of a resource – Sales Order in this case. You see that in the Search forms normally. It’s not perfectly in alignment with the internet religion but does provide a helper for those used to the List / Full pattern of querying in ERP10 / E9 / Vantage 8 / E4SE / Clientele. In REST we provided a simplified version of this through the ‘List’ resource –
https://localhost/erp10/api/v1/Erp.BO.SalesOrderSvc/List
Note the first three records for ‘query’. Let’s note the first one and do a ‘GetByID’. SalesOrder as a resource has two primary keys to identify itself. A Company and an OrderNumber. The help doc highlights this for us and gives a hint on the syntax for the ‘SQL where clause’:
Note how the Company and OrderNum fields are prompting you to enter the primary keys. Let’s grab that first record retrieved in the List and ‘try it out’:
There is the record in the Response Body. Note the ‘Request URL’ builds the ‘query’ for you. Let’s try that in a browser:
We are starting to see the syntax in querying that ERP10 supports. It’s an open standard named oData (www.oData.org). Let’s pull it apart a moment.
/SalesOrder(Epic06,5000)
‘SalesOrder’ is the resource as previously stated. If you used OrderRels it would have queried against that table instead.
(Epic06,5000) is the where clause. Note above the help doc said Company and OrderNum were required. oData uses that requirement to infer the column values being passed and which is which based upon the order they were displayed in the metadata above. If you want to be verbose you could state /SalesOrders(company=Epic06,OrderNum=5000). Both are supported, again the philosophy of doing what is asked of the client or integration.
So we can query in a fast lightweight fashion like a GetList. We can do a GetByID.
What about retrieving multiple rows like GetRows? Time to drop into more oData syntax and try out the filter command:
This builds out the URL:
Or in a browser address as ->
https://localhost/erp10/api/v1/Erp.BO.SalesOrderSvc/SalesOrders?filter=Company eq 'Epic06'
**_What is ‘eq’?_**
_**What’s with the goofy % things in the URL?**_
_**We are looking at a lot of columns in these tables making it hard to understand!**_
First let’s pull apart the query – ‘eq’?
Since this is an HTTP URL you have to follow all internet standards in making an address. ‘>’, ‘<’, ‘=’, ‘!=’ etc all mess up a normal URL. Instead of these oData has replacements:
Equals eq
Not Equals ne
Greater Than gt
Greater Than or Equal ge
Less Than lt
Less Than or Equal le
And and
Or or
Not Not
Spend some time in the oData examples if you need to learn the new syntax.
Next is the padding in the URL. This is URL Encoding (https://en.wikipedia.org/wiki/Percent-encoding). It’s a mechanism to not mess up URL parsing by using a ‘%20’ instead of a space for example. Most browsers automagically change spaces to %20 for you for example. It’s a simple translatioin.
Lastly, there are some extremely verbose tables in many Enterprise systems. One of my favorite parts of oData is being able to specify just the columns I care about.
Maybe we only want to see the open order status and the customer number?
https://localhost/erp10/api/v1/Erp.BO.SalesOrderSvc/SalesOrders?%24select=Company%2COrderNum%2COpenOrder%2CCustNum&%24filter=Company%20eq%20%27Epic06%27
**_Wow, just the data you want almost like a BAQ?_**
Pretty much. Without having to persist a new query to the server or ask IT for a new service you can tell the server through REST what data and how to shape it.
Not too many people are going to want to live their days in a browser to query the database though so let’s look at the world’s most popular querying client – Excel. You’ll need to refer to the docs for the appropriate version of when you need to download the oData addin from Microsoft but in the 2016 version it’s already baked in:
Let’s point at the SalesOrder service again with our ERP 10 user credentials:
And select the table you want to show
And you have a live link to the data behind the services with just client tool provided open standards. Nothing Epicor or Microsoft or anyone owns, just everyone agreeing to use an open standard.
The really nice thing about this under the covers is that Excel is speaking oData. Sorting, limiting columns, filtering of a column in the table all send across queries in oData syntax. This means you don’t dump the entire data base across the network and into Excel.
PowerBI, Tableau and anything speaking oData does the same thing.
**_Great for a readonly view of the world but what about Updating ERP 10?_**
All the URLs shown so far are simply reading data out of the system. An HTTP GET. GETS’s can be executed as a browser URL address and the response is shown in the browser client. Updating data uses the other HTTP verbs which need a tool or code to execute
POST – Does an Insert
PATCH – Does an Update
DELETE – Does a Delete
Underneath the covers the normal Update method is followed with validations, BPM intercepts, etc. There are code examples in the online help so based on your comfort zone learn what URL helpers play nice in your language and platform. They all have them. C#, VB, JavaScript, Python, PHP, Windows, Linux, it doesn’t matter. They always have an HTTP stack so can access ERP 10 directly now.
So take it for a tour, please ask questions. I am curious about what we did NOT think about.
---
## Post #2 by @kennethahayes
SOOOO excited to get my hands on .500 and try these out!
Thanks for sharing Bart!
[Ergobaby Logo]
Kenneth A. Hayes
Director, IT | Ergobaby
Find us: ergobaby.com | facebook | instagram | pinterest | twitter | youtube
---
## Post #3 by @Bart_Elia
It's obviously for customers but I hope to energize lots of partners with this tech. Tell me what you come up with for the ecosystem!
---
## Post #4 by @rbucek
Epic read, and very exciting! Thanks for sharing!
---
## Post #5 by @Bart_Elia
Had nothing to do on the flight ;)
---
## Post #6 by @josecgomez
---
## Post #7 by @josecgomez
I pinned this since it will be very useful once 500 is released to the messes. Thanks @Bart_Elia
---
## Post #8 by @Chris_Conn
This is all very exciting stuff - and so much content, thanks for your effort in putting this together (not to mention the actual hard work of making it happen). Now that I buttered you up, some stupid questions:
What version does this become available on? Is it already available?
How much configuration is involved in enabling these services?
I am certain my IT team will never in a million years touch this with a stick but I sure would love to play with it. My organization is really strange - literally my IT department manager rarely responds to my calls or emails, despite Epicor being such a big priority, with me right smack in the middle of it.
Would be nice if there was a way to setup my own test environment, on a device I control so I could wave some of these fancy solutions around in their face after the fact. That said - is there a such thing as a test setup I can get access to? I have had no exposure so far to the setup and configuration of an environment. If in fact, I do have access to such a beast, is there an Epicor setup guide for dummies?
---
## Post #9 by @josecgomez
This comes out in 10.1.500 out "soon" (it's out in beta and deployed to the epicor cloud already)
Configuration is a checkbooks or two in the admin console
You can setup your own environment get you an install guide and an epic web account. (Your employer can give you access) and go to town
There are all the user guides and install guides
---
## Post #10 by @Chris_Conn
Great found it. Now if only I had a Windows Server machine :blush: Despite all of my fancy SSDs and massive pool of RAM, I don't have the right OS. Are those requirements actual REQUIREMENTS or just really strong suggestions? (For the sake of playing)
Btw, how do you guys get those super cool title badges? I need one that labels me as "Thread Hijacker"
---
## Post #11 by @josecgomez
Ask and you shall receive... (Title)
Also get virtual box and install win server on it 😏
---
## Post #12 by @Bart_Elia
Butter up not needed. This group seems to have a lot of tinkerers and people pulling things apart. Also some outside the box thinking orgs/partners. It's marked tech preview because we want feedback. I am on another project now looking way forward but this tech or something similar is needed for it. I'd prefer to build coherent and iterative solutions everyone including myself can count on ;)
It is in 10.1.500 and live on SaaS.
Review the docs as mentioned in the overview. It's basically two steps
-Check the box in admin console to enable the settings in web.config
-Setup SSL in IIS
NOTE - We added documentation for using Self-Signed Certificates for SSL / HTTPS for those not willing to pick up an SSL in IIS book and try things out for free ;)
The question on reducing barrier of entry on getting things setup is a hot topic internally with a lot of great ideas bouncing around. Stay tuned and I hope by next Insights we will have some roadmap to share.
---
## Post #13 by @jgiese.wci
If you want a group of rule breakers you came to the right place LOL you have a couple rogues in here that find new ways to make Epicor bend to their will that make Nathan cringe lol
Joshua Giese
CTO
920.437.6400 x342
Wisconsin Converting Inc.
---
## Post #14 by @rbucek
I'm innocent, I swear it
---
## Post #15 by @josecgomez
Let's Encrypt for the win!!!!
https://letsencrypt.org/
I used it for my 500 REST setup works like a top no self signed needed 😁
---
## Post #16 by @Bart_Elia
If you already are running one of https bindings it's very simple.
The worst part is trying to understand vanilla IIS / SSL. Luckily that is generic knowledge any good IT person should either know or when they learn it it will be applicable everywhere. #NoThrowAwayKnowledge #NoSurprises
---
## Post #17 by @Bart_Elia
Now that's not what I mean, don't get me in trouble ;)
The whole point is reaching out to folks who go beyond the scripted help and try to apply technology in areas that even Epicor hasn't considered. And trust me we consider a ton behind closed doors - Being able to execute on it, have it be stable, easy to migrate to, supportable all are critical aspects to things beyond *oh this is cool tech*. It may be but at the end of the day we need to provide you folks business value. That's what we are supposed to be bringing to the table like any group you deal with. I could go to the farms in the area for my veggies (and do with the grand-kids) but a store is usually a little easier to do one stop shopping. We respect that and consider you folks all the time in our conversations to bring our customers forward in ways that makes sense.
---
## Post #18 by @Bart_Elia
Has LetsEncrypt been added to Microsoft Trusted Root authorities?
---
## Post #19 by @josecgomez
Yes sir! They are also cross signing so it's valid even before it's a direct root cert was added
---
## Post #20 by @Bart_Elia
Trying to tease that apart in their docs. I really do like the MS way of adding / revoking cert authorities out of band with other services - or roll it out in Group Policy.
I don't see LetsEncrypt or IdentTrust name in the trusted roots though. How is a client able to do third party assurance the certificate is legit?
---
## Post #21 by @Bart_Elia
oh found it - DST. Nice!
Do they do better than SHA2? Digging for that
---
## Post #22 by @Bart_Elia
Nope, only SHA2. Hopefully they will be using 256 soon.
---
## Post #23 by @josecgomez
Check out their trust chain doc
https://letsencrypt.org/certificates/
https://community.letsencrypt.org/t/which-browsers-and-operating-systems-support-lets-encrypt/4394
Short version they have been granted a trust cert and it's being added to the different browsers and OSes (slowly). However before that's all done they are cross signing their cert by IdenTrust ("DST Root CA X3" Root CA) a well known root authority that is established in all(most) platforms to establish trust even without the let's Encrypt authority being trusted directly.
Revocation works the same as any other authority and any revoked cert is revoked on both sides.
---
## Post #24 by @josecgomez
Actually I had forgotten, we have this site secured with let's Encrypt too! 😀
And nobody even knew about it, check out the cert
---
## Post #25 by @bconner
Hello All,
Product Owner for E10 REST Services here. I wanted to stop by and add that while the rest services are in tech preview mode in 10.1.500 we are actively seeking partners and customers who are interested in building solutions with them. Our primary motivation here is that we want to gather feedback from real world use of the services and encourage all of you early adopters get started with them. The whole point of these services is to enable you all to much more easily build integrations with Epicor and accelerate the ecosystem around Epicor Data. We're big [create more value than you capture](https://www.youtube.com/watch?v=y0CGT5AH7HE) fans, essentially.
We will be offering a more direct feedback channel for select customers and partners building against the tech preview as well as some additional resources like code samples, postman samples, etc. If you are interested in participating please feel free to reach out to me directly: **bconner at epicor**.
We're all really excited to see what you all will build.
---
## Post #26 by @bw2868bond
I am thinking it might be just a little more involved that a checkbox in the app server configuration :confused:
The following errors occurred while attempting to load the app.
- No assembly found containing an OwinStartupAttribute.
- No assembly found containing a Startup or [AssemblyName].Startup class.
To disable OWIN startup discovery, add the appSetting owin:AutomaticAppStartup with a value of "false" in your web.config.
To specify the OWIN startup Assembly, Class, or Method, add the appSetting owin:AppStartup with the fully qualified startup class or configuration method name in your web.config.
---
## Post #27 by @josecgomez
I have it working on several boxes this way, just check this box in server config, hit deploy
Then enable HTTPS endpoint in your IIS Website (Assing CERT)
And navigate to
https://myserver/myinstance/api/help
---
## Post #28 by @Bart_Elia
If you have the cert assigned to the web site it should be just the checkbox. Can you post the web.config (sanitized) It sounds like the REST section did not get enabled correctly for some reason.
---
## Post #29 by @bw2868bond
Don’t know if it makes a difference, but checkbox was not checked until today when 500.8 patch was applied
Web Config:
```xml
```
---
## Post #30 by @bw2868bond
Is this correct location for self signed cert?
[cid:image001.png@01D24A52.18473820]
---
## Post #31 by @josecgomez
Yeah Bernie your Web.Config got screwed up some how, Yours (Left) mine (Right)
https://www.diffchecker.com/wg4KoIJD
I'd recommed you just delete / re-deploy your 500 just delete the Application, AppPool, LocalClient folder and Config in the Deployment Directory then redeploy with the same name (so it doesn't break your existing clients)
Casue your web config is wayyy out of wack
---
## Post #32 by @bw2868bond
It is just a demo server – I can delete the app sever and directories and re-deploy
I am the only existing client ;)
---
## Post #33 by @Olga
Subject name for the certificate you use in Https setting must correspond to the site URL you connect.
So for localhost site, subject name in the certificate must be CN=localhost. (also localhost may be specified as SAN)
---
## Post #34 by @bw2868bond
Re-deployed as new app server and works OK
The upgraded app server di not.....
---
## Post #35 by @Bart_Elia
Thanks for the data point! I'll keep a look out for similar.
---
## Post #36 by @josecgomez
---
## Post #37 by @josecgomez
---
## Post #38 by @josecgomez
---
## Post #39 by @jgiese.wci
PHP example with UD05 on 10.1.500 works pretty slick. The Filter formatting is a bit weird but it works for me.
http://www.wisconsinconverting.com/epicor/MachineMapEpicor10.php
Physical machine locations / status
---
## Post #40 by @jgiese.wci
@Bart_Elia when I run a GET on LaborDtl without a filter I get results. When I run it with a filter I get a 200 response but nothing back for data. I ran a query against my DB to verify I actually do have records where ActiveTrans eq true but nuffin.... thoughts?
Testing it out no data.
Verified 3 records in DB
A serious wtf moment for me here
Just for kicks i tried the Labors vs LaborDtls methods and Labors worked with "Labors?%24filter=EmployeeNum%20eq%20'102'&%24orderby=ClockInDate%20asc" LaborDtls did not. It appears to be just an issue with the LaborDtls listing method
---
## Post #41 by @Olga
It maybe issue with limited count of records that return by default.
Try to add
key="DefaultMaxRowCount" value="0" into web.config appSettings section.
---
## Post #42 by @jgiese.wci
I figured out a workaround. I can't use Labor BO to query LaborDtl. I can't use LaborDtl becuase it's depricated. I had to use instead the LaborDtlSearches and that was ok. Contract.Labor in BL tester I get what I need but something in the API is goofy with that one. Oh well got a workaround none the less.
---
## Post #43 by @Stephen_Booth
I have a certificate setup and successfully in use, and we just checked the checkbox for REST, but we're getting a 500 Internal Error trying to perform any task through REST. Even in swagger, if I click the link to any of the services I get this:
500 : Sorry! Something went wrong. Please contact your system administrator. https://ourserver/ourapp/api/swagger/v1/odata/Erp.BO.ABCCodeSvc
---
## Post #44 by @josecgomez
Can you browse the help page?
https://YourServer/YourShare/api/help
---
## Post #45 by @Stephen_Booth
Yes, I can, and I get the list of services and all, but as soon as I click on the service to view the details that 500 error is what I receive.
---
## Post #46 by @josecgomez
What do you see in your EventViewer on the server side?
---
## Post #47 by @Stephen_Booth
Nothing of significance. I've even run this from the server, and I get the same error, but nothing in the event viewer. This is what I get in the server trace log (after enabling logging for rest).
---
## Post #48 by @Stephen_Booth
I should note I have Windows Authentication enabled on the instance web site. I was trying to get SSO working. If I turn off Windows Authentication I receive the same error from swagger on the ABCCodeSvc web page, and the same error in the trace log, just with the Auth Header scheme changed to Basic.
---
## Post #49 by @josecgomez
Try creating a WindowsChannel App Server and using it there... I suspect the SSO/WindowsAuth stuff is causing issues.
---
## Post #50 by @Stephen_Booth
We're currently using a Windows Channel app server. That's why I tried using SSO. I'll try setting this up in another environment. Maybe something went awry during initial installation.
---
## Post #51 by @Stephen_Booth
After creating a completely new app pool, I'm getting the following errors in event viewer now when I try to get to the ABCCodeSvc in Help:
ERROR 1:
Epicor.RESTApi.ErrorHandling.ApiException: Incorrect service name. Example: Ice.BO.TipSvc
at Epicor.RESTApi.Misc.RouteMapping.GetTypeMappingFromPath(String svcName) in c:\_Releases\ICE\3.1.500\Current\Source\Framework\Epicor.RESTApi\Misc\CommonFunctions.cs:line 43
at Epicor.RESTApi.ODataHelpers.v3.RouteHelper.BoServiceModel(HttpRequestMessage request, String[] segments) in c:\_Releases\ICE\3.1.500\Current\Source\Framework\Epicor.RESTApi\ODataHelpers\v3\RouteHelper.cs:line 107
at Epicor.RESTApi.ODataHelpers.v3.CustomODataPathRouteConstraint.Match(HttpRequestMessage request, IHttpRoute route, String parameterName, IDictionary`2 values, HttpRouteDirection routeDirection) in c:\_Releases\ICE\3.1.500\Current\Source\Framework\Epicor.RESTApi\ODataHelpers\v3\CustomODataPathRouteConstraint.cs:line 69
at System.Web.Http.Routing.HttpRoute.ProcessConstraint(HttpRequestMessage request, Object constraint, String parameterName, HttpRouteValueDictionary values, HttpRouteDirection routeDirection)
at System.Web.Http.Routing.HttpRoute.ProcessConstraints(HttpRequestMessage request, HttpRouteValueDictionary values, HttpRouteDirection routeDirection)
at System.Web.Http.Routing.HttpRoute.GetRouteData(String virtualPathRoot, HttpRequestMessage request)
at System.Web.Http.HttpRouteCollection.GetRouteData(HttpRequestMessage request)
at System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Web.Http.HttpServer.d__0.MoveNext()
ERROR 2:
System.NullReferenceException: Object reference not set to an instance of an object.
at Swashbuckle.Application.SwaggerDocsConfig.GetSwaggerProvider(HttpRequestMessage swaggerRequest)
at Swashbuckle.Application.SwaggerDocsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpMessageInvoker.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Web.Http.HttpServer.d__0.MoveNext()
---
## Post #52 by @josecgomez
Have you tried another Service? I had issues with 1 service but everything else worked fine
---
## Post #53 by @Stephen_Booth
Every service I try produces the same result. What is odd, if I go to the BAQ section for the help it is able to "autofill" the BAQ Name field with our BAQs. So I can start typing in the field and it retrieves the list of BAQs that match what I typed in. I'm assuming those are built as needed and aren't built at application pool startup.
---
## Post #54 by @Stephen_Booth
Not sure what I did (just kept trying) now my API calls work. The help still performs the same (errors), but my API calls work.
---
## Post #55 by @Olga
> open your web.config, find the following line
>
>
>
> and add these string after it:
>
>
>
>
>
>
>
>
---
## Post #56 by @Noffie
Are the RESTful APIs the reason behind adding all of these new Endpoint bindings that I didn't see in Epicor 10.0? `HttpBinaryUsernameSslChannel`, `HttpsBinaryWindowsChannel`, etc?
If not, any idea what these are for and how they differ from the ones we had in Epicor 10.0?
---
## Post #57 by @josecgomez
I believe that most of these are for HTTPS deployments over the WAN... (Think SaaS)
---
## Post #58 by @Olga
REST does not use these endpoints,
They are for WCF clients.
Difference from e10.0 is these new endpoints are based on http, not on tcp.
---
## Post #59 by @Bart_Elia
Olga is correct. REST does not use WCF and is pure vanilla http(s).
---
## Post #60 by @Lee_Fry
Hey Guys,
I have been playing around with this REST custom methods stuff but I can't seem to figure out the whereClause part, for instance how would I get a list with all parts that start with or equals CMD1 etc
I have tried guessing the syntax such as whereClause : "{"PartNum":"CMD1"}" but this is more mongodb style than anything .
I cant seem to find the appropriate help document for this whereClause so if anyone can point me in the right direction it'll be much appreciated?
Many Thanks
Lee
---
## Post #61 by @Mark_Wonsil
Lee,
If you set a trace on a Part Description search, it may show you the format for the Where clause there.
Mark W.
---
## Post #62 by @josecgomez
whereClause is SQL Style Field=XX
---
## Post #63 by @Lee_Fry
Thanks Guys... for some reason I was over thinking it all- I didn't even consider that it would be the same as the SQL standard! /FacePalmsSelf :blush:
---
## Post #64 by @aluminumforest
How are you performing the GET request using the URL in your code? I'm trying to use $.ajax() in a simple test intranet page but am having issues retrieving the data.
Any assistance you might be able to provide would be helpful!
Thanks,
Ben
---
## Post #65 by @jgiese.wci
Use PostMan application for your specific language it will give you the code. If you are using jquery there will be plenty of examples online of how to perform an async get request using ajax. Make sure you use the RestAPI documentation pages within the application for the URL paths you need to call copy and paste makes life easy.
---
## Post #66 by @aluminumforest
Thank you for the PostMan recommendation. That's a great tool! I'm able to get it to work in the Chrome version with no auth, and in the native version with SSL-verification disabled, but not in my test script. I'm wondering if my problem is on the server side. I've tried everything I know of but I keep getting either 400 preflight request errors or 401's.
Anyway, thanks for your helpful response. I'll keep chipping away at it!
Ben
---
## Post #67 by @Aaron_Moreng
Sorry if I'm way behind, but we finally got our DEV environment configured to accept SOAP API calls according to the example in the WCF developers guide.
Is there any harm in trying to setup the REST API preview in addition to the SOAP configuration?
I would hate to start developing our integrations in one way if another way is the future/preferred way.
---
## Post #68 by @jgiese.wci
You should have no problem running both.
---
## Post #69 by @Aaron_Moreng
Does the payload still go through the Epicor business logic layer or does it hit the database directly?
---
## Post #70 by @jgiese.wci
Goes through the normal channels like any other external service Epicor provides just like the webservices.
---
## Post #71 by @Bart_Elia
All the endpoint stuff is correct as said above. Check out the 'networking options' in the help. We did a lot of work in there explaining why to choose what, etc.
We use WCF for the standard clients - choose one of each - net.tcp, http, https.
For REST we use a different url endpoint (Note the /api in the url) and use WebAPI, not WCF.
Both of these technologies route to the same business objects. The wrappers change, the BOs stay the same. Over time we are talking internally about some REST optimized routes through the server but nothing to advertise at this time.
---
## Post #72 by @jgiese.wci
@Bart_Elia SAFE HARBOR SAFE HARBOR! lol :)
---
## Post #73 by @Bart_Elia
Comments are my own and not an endorsement by my employer ;)
---
## Post #74 by @aluminumforest
Ended up being a silly web.config problem on the intranet side. All works fine now, thanks again for your help!
---
## Post #75 by @Marvin_Horst
This is really cool thanks for sharing. I plan to use this.
I have found a bug in the help when using the "Switch to Custom list" link I get an unresponsive script message, at this location.
api/help/odata/Erp.BO.JobEntrySvc/index
Is there someplace ww can submit bug reports?
---
## Post #76 by @Bart_Elia
There is a timeout issue we are working on that Swagger takes forever to build the help page meta for huge services - lots of methods, lots of tables, lots of columns. fyi - Swagger is a project common on the internet for describing REST APIs. MS Azure uses for example.
We may need to work with the swagger dealing with our larger API surface. It's in scope for 10.2 but nothing to report yet...
---
## Post #77 by @Olga
try to use another browser, like Chrome x64 or Opera.
---
## Post #78 by @Bart_Elia
Olga is correct - this building of the doc page is faster in different browsers. Which one are you using when you received the error? (and version)
---
## Post #79 by @Marvin_Horst
I'm using Chrome 64bit. Whatever was causing the issue has gone away and I am not experiencing this problem anymore. My Chrome browser was recently updated or possibly my server has become more responsive.
:) Thanks for the input.
---
## Post #80 by @Bart_Elia
Good to hear. Just finishing the labs for Insights. So excited to give the 4 hour extended ed and 1 hour labs.
---
## Post #81 by @Lee_Fry
Hey Guys,
Is there any advanced documentation floating about for the Rest API (more specifically for the custom methods variant)
I've been able to do all sort of fun magic with this API in golang so far- however the one thing I've not been successful at is adding materials or operations to a part via the EngWorkBenchSvc so was hoping there may be so shiny documentation other than whats available on the swagger pages.
Also @Bart_Elia Do you know if there will be a recording or some slides available for those unable to attend you Insights lab?
Thanks in advance
---
## Post #82 by @josecgomez
@Lee_Fry GoLang!!! you get extra points!!!
---
## Post #83 by @Bart_Elia
I am not sure the availability of Insights material outside of Insights. I'll dig into those details internally. You can always ping me here or on twitter as many of you already like to pester me ;)
I have a few things on my wish list but not on the roadmap for REST in 10.2 so no commitments yet.
A couple of things I want to do:
* Improve company handling
* Add additional metadata (No extended property details in swagger yet)
Another general wish is increased 'business documentation' around certain popular areas. I think we have all seen enough docs from many APIs and many companies that define _Name: The name of the thing._
What I would like to see is more business process oriented descriptions from the API help along the lines of MSDN style remarks.
Stay tuned...
---
## Post #84 by @Lee_Fry
@josecgomez Thanks ^.^ I do love the golang! hehe!
@Bart_Elia Thanks for the heads up, I shall keep tuned in- and a little excitable! :)
---
## Post #85 by @tkoch
Hi Lee,
I put this together because I was also curious how the custom methods worked. See below, not if this is the best way, but the first way I figured out how to make it work.
```cs
static void Main(string[] args)
{
var client = new RestClient(_serviceUrl + @"/Erp.BO.SalesOrderSvc/GetByID");
var request = new RestRequest(Method.POST);
request.AddHeader("authorization", "Basic " + Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(string.Format("{0}:{1}", "shop", "shop"))));
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{orderNum:7045}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
SalesOrderTableset ds = new SalesOrderTableset();
JObject jo = JObject.Parse(response.Content);
ds = jo.SelectToken("returnObj", false).ToObject();
ds.OrderHed[0].PONum = "TEST";
ds.OrderHed[0].RowMod = "U";
string data = "{\"ds\":" + JsonConvert.SerializeObject(ds) + "}";
client = new RestClient(_serviceUrl + @"/Erp.BO.SalesOrderSvc/Update");
request = new RestRequest(Method.POST);
request.AddHeader("authorization", "Basic " + Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(string.Format("{0}:{1}", "shop", "shop"))));
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", data, ParameterType.RequestBody);
response = client.Execute(request);
}
```
**EDIT** Figured out how to add a new line also (FYI). Probably not the most elegant way, but still playing.
```cs
static void Main(string[] args)
{
var client = new RestClient(_serviceUrl + @"/Erp.BO.SalesOrderSvc/GetByID");
var request = new RestRequest(Method.POST);
request.AddHeader("authorization", "Basic " + Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(string.Format("{0}:{1}", "shop", "shop"))));
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{orderNum:7045}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
SalesOrderTableset ds = new SalesOrderTableset();
JObject jo = JObject.Parse(response.Content);
ds = jo.SelectToken("returnObj", false).ToObject();
string data = "{\"ds\":" + JsonConvert.SerializeObject(ds) + ",\"orderNum\":7045}";
// add new line
client = new RestClient(_serviceUrl + @"/Erp.BO.SalesOrderSvc/GetNewOrderDtl");
request = new RestRequest(Method.POST);
request.AddHeader("authorization", "Basic " + Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(string.Format("{0}:{1}", "shop", "shop"))));
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", data, ParameterType.RequestBody);
response = client.Execute(request);
jo = JObject.Parse(response.Content);
ds = jo.SelectToken("parameters", false).SelectToken("ds").ToObject();
Epicor.SalesOrderSvc2.OrderDtlRow row = ds.OrderDtl.FirstOrDefault(r => r.RowMod.ToUpper() == "A");
row.PartNum = "test";
row.LineDesc = "test";
// update
data = "{\"ds\":" + JsonConvert.SerializeObject(ds) + "}";
client = new RestClient(_serviceUrl + @"/Erp.BO.SalesOrderSvc/Update");
request = new RestRequest(Method.POST);
request.AddHeader("authorization", "Basic " + Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(string.Format("{0}:{1}", "shop", "shop"))));
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", data, ParameterType.RequestBody);
response = client.Execute(request);
}
```
---
## Post #86 by @Lee_Fry
Hey,
Thanks for this, it's nice and simple to follow, I shall convert it to golang and see how I get on with the EngWorkBenchSvc as this is where I'm having some problems with currently.
With all the other stuff I did such as CRM notes, customers, and part creations I could get away with just calling the UpdateExt method, and that would take care of adding a new or updating a record for me, whilst With the EngWorkBenchSvc it seems to require little more depth, such as GetRows, GetNewECOMtl, ChangeECOMtlMtlPartNum & then Update.
Thanks again.
Lee
---
## Post #87 by @Banderson
Nice work on the rest presentation @Bart_Elia. I'm not a programmer and it's nice to see what you can do easily with this.
---
## Post #88 by @GregHeeley
Hi Bart
After attending the Extended Ed session on REST, I went looking for Brian's GitHub repository and there's nothing there for the example Web Page, I'm being a bit lazy but it would be great to get hold of the finished example.Any clue on where It could be obtained?
Cheers
---
## Post #89 by @josecgomez
Greg
There are several examples in Brian's git hub, are you sure you weren't too the right place?
https://github.com/bconner
---
## Post #90 by @LeonFeder
Hi Bart,
I loved your presentation at Insights and have gotten somewhat set up to start playing around with the API. A few parameters are important to state up front. First, we're a single-tenant cloud customer. Second, I'm very new to Epicor and haven't had to deal with web server configuration for the past two decades (I did a lot of early work with Apache before the wheel was invented).
If I do a remote desktop to the hosted server, I am able to access the API. However, when I try to access it outside, I receive the following error (actual URL changed in Chrome):
**This site can’t be reached**
**99999-e10-test.epicorhosting.net’s server DNS address could not be found.**
I was asked by EMS:
_Have you imported the self-signed certificate to the Trusted Root CA as per the guide?_
_You can import the self-signed certificate by double-clicking on the PRX file and it will launch a wizard to take you through the process (it's in the guide as well)._
I'm not sure where to find this information or what I'm supposed to do. I assumed that I would be asked to import a certificate in the browser when I tried to access the URL but I didn't get that far. Should I be able to access the API outside? I would hope so. Is it an IIS configuration issue?
---
## Post #91 by @Olga
looks like your browser does not see 99999-e10-test.epicorhosting.net
Certificates are not involved here yet.
---
## Post #92 by @LeonFeder
I agree. As a cloud client, I'm wondering if there's a separate "Public" URL I need to use. The 99999-e10-test.epicorhosting.net address does not seem like what users would enter. I'm just wondering what step is missing. Is this something defined in IIS?
---
## Post #93 by @Bart_Elia
Leon, reach out to your SaaS admins. They should know how to flip the switch. It sounds like whatever you have for a certificate is not trusted by your client PC. This is a normal thing when a dev stands up a test certificate on a server - then any client trying to contact the server has no clue if it should trust it or not. That's the whole point of Verisign, LetsEncrypt, etc. They work with Microsoft so the OS trusts those certificate vendors so you don't have to manually add anything to your certificate store on your client.
Either that or the port is blocked. Start with the SaaS admins, they know me too well ;)
---
## Post #94 by @Chris_Conn
FYI - Bart Ellia and Brian Conner just did a REST webinar over at EUG. If you are an EUG member, you should be able to access it in a few days.
Thanks @Bart_Elia
---
## Post #95 by @Bart_Elia
@bconner did the presentation. I was there for comic relief...
---
## Post #96 by @ewelsh
The webinar was great, You asked me to reach out about the bug decrementing the PwdGrace value in the Ice.SysUserFile table. Is there a workaround, currently I have put a very high value through tsql?
---
## Post #97 by @prima854
Hi, I'm having trouble filtering by guid. This what I think is supposed to work, but I'm not having any luck:
$filter=SysRowID eq guid'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
I've tried a ton of variations like the v4 way ($filter=SysRowID eq XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX) and nothing seems to work, I just keep getting 500 error back. I'm able to filter on other fields so I know I'm not completely terrible at this, I'm just stumbling on the row ID. Is it possible to filter on SysRowID?
Thanks for any help.
---
## Post #98 by @Olga
What version do you use? it was fixed at some point
Syntax should look like $filter=SysRowID eq guid'e830ab94-680b-49fe-882c-9f9d0117ac39'
---
## Post #99 by @prima854
We're on Epicor 10.1.500.18. We have someone else administering Epicor so I'm not 100% knowledgeable on what versions fixed what, but I've heard talk that this one is pretty early in the REST evolution, so it would make sense that we're just using an old version that has some bugs.
I'll get with the team and push them to update to the latest and see how it goes, thanks! and thanks for letting me know what it should look like too.
---
## Post #100 by @Olga
yes, it will be in 500.20+
---
## Post #102 by @rapat_mark
Trying to get REST up and running so @Banderson has some more toys to play with. We did not generate the self-signed SSL security certificate during server install. The instructions say "You must complete these steps prior to adding an Epicor Application Server". Can I still add the certificate after the fact?
---
## Post #103 by @Banderson
Yessssssssssssssss............

---
## Post #104 by @Bart_Elia
You might be reading the steps to setting up a cert for the WCF binding as opposed to the REST endpoints?
I just got a peak at the new admin console approach and like it better so hopefully is easier. I am sure I can count on you folks to provide me with '_enthusiastic feedback_' when you get your hands on 10.2
---
## Post #105 by @josecgomez
No, simply install a self signed cert in your server /iis and enable https binding on your website in iis.
Then check the REST checkbox (if you haven't already) and you are off to the races
-Jose
---
## Post #106 by @rapat_mark
Done deal. Thanks Bart and Jose!
---
## Post #107 by @Banderson
Now I have some work to do to try to figure out how to use it. Good thing I have all the above information to hopefully get me started.
---
## Post #108 by @Banderson
I'm having some problems with the certificate. I can get a query to run in the web browser, but when I try to bring in the address to excel to use the Odata import, I get this error. Any idea what we are missing?

---
## Post #109 by @Bart_Elia
Excel requires a higher level of trust than getting a warning in a browser and 'proceeding unsafely'. If your self signed cert does not get stored in the correct place in the certificate store, Excel complains. There is no Excel version of 'ignore warning and proceed unsafely' that I am aware of.
---
## Post #110 by @Banderson
When I first try it in a new excel sheet, I get this warning. I can view the certificate and install it (using the defaults that it provides), but that doesn't seem to to anything different. Is there something that needs to be done to the SSL itself to allow this?

I've been trying to follow these steps as well, with no luck. I can get the cert from the browser but don't know where to put it (or if it's even the right one)
https://success.outsystems.com/Support/Enterprise_Customers/Installation/Install_a_trusted_root_CA__or_self-signed_certificate
---
## Post #111 by @josecgomez
Yeah that was a deal breaker for us, we ended up coding around it with a VSTO plug in for @jgiese.wci (we demoed it a bit at insights earlier this year). Excel is super zealous with security (for a good reason)
There is no known way around it other than having a legit cert that excel trusts. If you are in a domain you could try and push it via GPO and an internal CA , or install the internal self signed cert on each work station but that was also a pain point we couldn't always get past.
---
## Post #112 by @Banderson
To take a page out of @Chris_Conn 's book.

I don't even know what any of those acronyms even mean....
---
## Post #113 by @josecgomez
VSTO is an office add in written in .NET (Think XL Connect)
GPO (Group Policy) is a way to manage your workstations and network from a central location with a set of "Policies"
CA (Certificate Authority, allows you to issue / mint your own trusted certificates within the bounds of your network domain)
---
## Post #114 by @NickTu
This is great, but what references did you need to add in order to use SalesOrderTableset and Epicor.SalesOrderSvc2.OrderDtlRow?
Thanks
---
## Post #115 by @josecgomez
You create those using the example I outlined above.
---
## Post #116 by @NickTu
Sorry, I must be blind, but I can't find the example you're referring to. Would you be a bit more specific, please?
Thanks.
---
## Post #117 by @Bart_Elia
@NickTu are you trying to write a C# integration against the REST APIs?
Because the whole point of REST is that you do not HAVE to make dll references against the dotNet assemblies. In fact you cannot in all cases - we have C#, VB, C++, Perl, Php, Go and even Cobol clients talking to this. And many different OS and even devices that don't have much more than a http stack.
Adding a dll reference to Erp.Contracts.BO.SalesOrder.dll to get the C# type CAN be done in Windows and dotNet but ...
CAN you do that? Obviously the list above shows scenarios where it is not a possibility.
Do you WANT to? If those dlls change with a patch or a version change, you need to manually deploy and possibly recompile your integration depending on scenario.
So, a little more context and we can give better options :)
---
## Post #118 by @NickTu
Thanks for the explanation. I'm just trying to follow the sample code from tkoch (above) where he updates a sales order, but also instantiate and use the SalesOrderTableset object. It does make a lot more sense to not have to reference any dll or WCF service.
---
## Post #119 by @josecgomez
I was referring to the Integration Post where I gave an example of creating a JSON Class from REST
https://epiusers.help/t/integration-doc-beta-testers-needed/38631/29
---
## Post #120 by @NickTu
Found it. Thanks!
---
## Post #121 by @Bart_Elia
[quote="NickTu, post:118, topic:36260"]
It does make a lot more sense to not have to reference any dll or WCF service.
[/quote]
That's the real emphasis I am trying to make. During V8/E9/E10 I worry that we have been doing internal development a certain way and our customization is currently the same way and examples have historically been rather dictatorial - "Do it our way and on Windows". That's not what integrators are forced to do. You should have more flexibility in how you consume ERP data and dictate to us what you want and how you want it.
At the same time, I respect that giving no guard rails can be more than a little intimidating and worries about guidance and support ... where are you going to get it? Unfortunately that's kind of the trade off we all face in IT.
---
## Post #122 by @Banderson
Is this a thing that's coming (or exists) with E-10? I'm looking at productivity platforms right now and bring in some basic status information from E-10 may be an interesting idea in the future. (and I always dream big)
http://resthooks.org/
---
## Post #123 by @Bart_Elia
*Safe Harbor, forward looking, yada yada*
Webhooks in general are an interesting and valuable approach. I have hacked something similar into a coded BPM with off the shelf E10 to play with the idea. SignalR is already used in several areas in E10 (e.g. Social) and gives another interesting architectural tool.
Take a look at what is happening in Mobile CRM and Active Home Page and you can assume we are looking at options. Not breaking the heck out of existing customers is of course a priority but adding value for more interesting integrations ana capabilities is always being reviewed.
Sometimes they fail for a variety of reasons, sometimes they make it into the product and evolve. Vantage 6 to dotnet front end in V8/E9 to dotnet server v10 anyone?
Keeps the ideas coming, I'll comment as I can reasonably do so ;)
---
## Post #124 by @Banderson
Does the rest help functions not work in firefox? When I click on this button in firefox, nothing happens. If I do in chrome I get the help info to pop up. Or do you think it's something to do with my personal settings?

---
## Post #125 by @Olga
it looks like a bug in Get help button submitBaqForm function.
---
## Post #126 by @Mario.Cortes
Is this still on going?
---
## Post #127 by @josecgomez
2 posts were split to a new topic: [CORS Issue with Epicor REST](/t/cors-issue-with-epicor-rest/42839)
---
## Post #128 by @bconner
We ended the preview discussion board near the beginning of this year since we're now in our second GA release of rest services and the preview was mostly for gathering feedback before we went officially GA. So that project is ended, but we may bring something similar back later this year as we're looking at doing a vNext set of rest capabilities and are interested in your feedback.
Regardless you can always send me bconner at epicor dot com any feedback you have about the rest services.
---
## Post #130 by @josecgomez
No as far as I know. But you don't have to use it for everything. What's the use case?
-Jose
---
## Post #131 by @David
Apologies, I hit delete a bit hastily. I'm hoping to expose only a select few services over REST to limit the business impact, and sort of 'pilot' the new REST interface (over the WCF foundation). With that, I don't want to go exposing all the business objects, just a few (for example, only Customer and Territory). I'm assuming the "Enable RESTful services" checkbox is an overarching enable, and the only way to limit access is via a custom gateway that directs calls down to Epicor?
---
## Post #132 by @josecgomez
[quote="David, post:131, topic:36260"]
limit the business impact
[/quote]
As far as I know you can only enable all or nothing, but there is no business impact to doing so. The REST interface is merely a facade to the existing WCF Services. There is no downside to exposing them all
---
## Post #133 by @David
Ahh awesome, thank you for clarifying that Jose. I thought as such, and this was actually going to be my next question but you've read my mind in regards to it being a facade for the WCF.
---
## Post #134 by @Bart_Elia
Jose is correct on implementation. The Method Security is probably the way to go. That is done at the BO level so will cover you no matter which way someone accesses the BO. If we locked down just the REST endpoints, you are just making the minimum code to do damage two lines of code instead of an HTTP URL.
If you need to lock down a service, I'd tackle it there.
If you REALLY think you JUST need to lock down REST but leave a security hole a semi can drive through in WCF, you could look at a firewall solution with content filtering. I have not played in that area of IT Hardware in awhile so I'd defer to someone with more current domain expertise and available approaches / devices.
---
## Post #135 by @mchinsky
Has anyone been able to figure out how to get odata to return the list of all BAQ's? Not in the browser, but to an application like Excel so you can choose.
If you connect to a SQL data source in Excel, you can pick the table(s) you want.
It seems with odata and epicor, you have to explicitly know the syntax of the one baq you want to retrieve.
---
## Post #136 by @Banderson
If you take that address from the swagger page, and use that to in the from web section in excel, it will walk you through loading a file that will list all of the BAQ's. It looks like you can refresh that list too. It's not Odata, it's XML, but if I could figure it out, it must not be too hard. Not knowing your end goal, I don't know if this does what you want or not, but it's possible to get a list in excel.


---
## Post #137 by @Bart_Elia

---
## Post #138 by @mchinsky
Thanks. I probably worded that poorly. I'm not looking for the list of BAQ's to show up in the excel grid. Rather the Import data screen, when connected to an ODBC or SQL data source will show you the list of 'tables' in your database, and then you can select one or more to pull into either excel or the query manager.
But with rest, it seems, you can only directly retrieve the one BAQ and you have to know the URL in advance.
---
## Post #139 by @Bart_Elia
Correct, the scenario you are describing is more of a data mining type scenario. You may want to look at the EDD product to see what I mean. That gives you the flexibility you mention but with a level of security in mind.
Excel or any product going directly to the db is not encouraged. Not banned, but you should go in with eyes wide open since you are bypassing all security and calculated columns when going directly to sql. That's why the design of the feature is to package up your query in BAQ and then consume it in Excel or other clients.
---
## Post #140 by @mchinsky
My ultimate problem is that I'm using a Data Warehouse automation product (TimeXtender) that lets you pull in SQL tables and it builds the data warehouse and the SSAS Cubes.
However, if I want to build this to work with Epicor SaaS that allows no direct access to SQL but does allow Odata access, I need to use a 3rd party Odata ODBC driver. However, like other ODBC sources, it connects to the 'source' and then you specify the 'table'.
I guess I'll have to work with the ODBC driver folks to figure out how to make this work.
---
## Post #141 by @Bart_Elia
If tools are only dealing with SQL today, those tool companies are going to have a very smaller customer base in the near future.
OData or Graph QL are becoming bare minimum features
---
## Post #142 by @John_Mitchell
@Bart_Elia Epicor needs to join the Open Data Initiative https://www.microsoft.com/en-us/open-data-initiative and map their data to the Common Data Model https://github.com/Microsoft/CDM
@mchinsky check out the new PowerBI release. They added the ability to ETL from a REST API to a hosted SSAS instance. They are also adding XMLA endpoints to the PoweBI models so you can query the data from any app that supports it (Excel, SSMS, PowerBI, EDD if they add it). https://www.jamesserra.com/archive/2018/08/power-bi-dataflows/
---
## Post #143 by @josecgomez
A post was split to a new topic: [Issues with REST BAQ](/t/issues-with-rest-baq/55223)
---
## Post #144 by @mchinsky
I was playing around with Data Flows myself. I think this is a key move because it separates the ETL that was embedded into your PowerBI document, into a standalone function that creates governed simplified data that is accessible to all PowerBI users.
The problem I found is the PowerQuery in PowerBI online has significantly reduced functionality from the desktop version. For example, I couldn't find any way (without writing your own M code) to simply tell it a column that comes over as Text is actually a number (because of the totally broken way Epicor has configured BAQ's in both the V1 & V2 implementations). All data from the BAQ's comes over as text and you have to use the Powerquery tools to convert into numbers, dates etc.
The only workaround I found was to do all the work on PowerBI desktop. Then go into the 'advanced mode' that shows the 'M' that gets created. Then literally copy and paste that into PowerBI Data Flows advanced editor.
Epicor still needs to fix the way they publish BAQ's in order to not have to create a separate connection for each query which is slow and clunky for projects you create. You should be able to establish one connection (like you do with SQL Server) and then pick the 'tables' which should be each individual BAQ.
---
## Post #145 by @mchinsky
@Bart_Elia I agree with your statement about needing to move from SQL to Odata as a tools company. But Epicor needs to actually comply with the Odata standard.
As far as I know, and please correct me if I'm wrong, there is no way to connect to the BAQ Service, and then pick off the BAQ's you want to use in Excel or any other odata consumer. You have to establish a separate login & connection for each and every BAQ you want to consume.
The BAQ's should appear the same way, for example, the Sales Order Service does where you see all the 'tables' of data the sales order provides.
---
## Post #146 by @Bart_Elia
We were looking at options on BAQ but BAQ service is not the resource - the baq itself it the resource. That means the tables are specific to the individual BAQ as a service. If you read that as a cop out, I'll take that abuse. ;)
We need to support a baq hierarchy as a service to deliver what I think a lot of folks desire. We did this for Electronic Compliance for example - https://www.epiusers.help/t/ssrs-psa-on-filtering-subreports-performance-fixing/55699/12
If we treated BAQ itself as an end point, the meta on that would take out a few datacenters trying to generate the meta. The generators out there like Swagger are just not built for large data that would be visible under all the BAQs visible to a user. We've scanned more than a few generators and scoped what it would take to create an incremental loading mechanism for all the meta (open Customer and you'll see the need as well).
It's an open question and the PO over REST @bconner has looked at this a few times. There are some other activities underway they are ahead of this on the delivery train atm but it is an interesting problem we wish to tackle.
---
## Post #147 by @mchinsky
One option would be a check box on the BAQ setup such as 'enable REST Access'. Then a company would only check this on the BAQ's they need to provide external access to which is likely far fewer (less than 50) than total BAQ's in the system.
When you generate the BAQ hierarchy you would do so for just those with REST Access enabled
---
## Post #148 by @Bart_Elia
You should look at the BAQ security added in ... ?10.2.300? and the Access Scope feature added to 10.2.400.
Both were added to manage security on BAQ and REST services.
REST is the basis of everything going forward so definitely start thinking of how to apply it.
---
## Post #149 by @svanniman
Where did you find it?
---
## Post #150 by @NickTu
It’s been a while, I think it’s the url referenced by Jose:
https://epiusers.help/t/integration-doc-beta-testers-needed/38631/29
Nick
---
**Canonical:** https://www.epiusers.help/t/rest-overview-novel/36260
**Original content:** https://www.epiusers.help/t/rest-overview-novel/36260