I’m trying to test out this service with POSTMAN: https:/xxxx-epicor10/E10Train/api/v1/Erp.BO.SalesOrderSvc/SalesOrders
If I don’t add parameters I get all the data returned. When I add parameters company and ordernum both of which exist in the TRAIN environment, it says “Sorry Something went wrong.”
you need to turn off custom errors so you can see what the actual error is… its the web.config otherwise look in the event viewer in the server to see the error.
My gut says its saying “Record Not Found” (which GetByID returns if the record isn’t found)
But where in the web.config file does that go? Between which tags? Or outside all of them? There is already a <system.webServer> section should it go there?
So I’m trying it with the Swagger tool and It looks like the service is completely ignoring the company and defaulting to one company and only that company.
We have two companies in our database but it’s only finding orders for the first.
This seems like a bug. What could be the reason for this behavior?
None of this stuff is straight forward and better yet it’s not documented on the swagger. callContextHeader seems to be required to set the company.
The company in the URL doesn’t do anything yet needs something to be populated in it (counter-intuitive and confusing IMO).
In case anyone is looking for how to do it in PHP with CURL (EDIT the following PHP code was fixed with information from replies later in this thread and is good to run)
Hmm actually that callContextHeader you are passing isn’t a valid header. Not sure why it now “works” for you if I had to venture a guess is you logged in into Epicor and changed to that company so your session got updated.
The actual Header you need to send is CallSettings as documented here
There is a lot of stuff documented, here on the forum and on Epicor Help and on the various Guides.
IF you haven’t done so I recommend a thorough browsing of the “Experts Corner” in this forum as well as looking at the documentation SWAGGER, the Epicor Help Regarding REST, EpicWeb Documentation such as the Customization Guide and Exprience User Guide as well as the Web Services Technical Reference.
What is callContextHeader then? Did you mean CallSettings? Sorry to ask but these terms are all brand new for me and I’m a little out of my depth here.
The documentation seems incomplete to say that that’s where you enter the company yet it plays no part in the actual request but yet the request will fail without something there. More importantly do other services act the same way?
Maybe a note inside the swagger to mention that CallSettings must be set to select the correct company would be good?
I found the call settings under help now that it was pointed out that those are needed but I’m not sure I would have known without this forum’s help … so thank you for all your help thus far.