REST Question

So been using Swagger to figure somethingsout and so far going pretty good. However, I do have one question that I can ot seem to solve.

This one works as expoected:

https://my server/ERP101500/api/v1/Erp.BO.SalesOrderSvc/SalesOrders(VT,372970)?%24select=SoldToAddressList%2C%20SoldToContactName%2C%20SoldToContactPhoneNum%2C%20TotalLines%2C%20TotalReleases

But this one will only show me line one not line 2:

https://e10-test2/ERP101500/api/v1/Erp.BO.SalesOrderSvc/OrderDtls(VT,372970,2)?%24select=OrderNum%2C%20OrderLine%2C%20LineDesc%2C%20OrderQty%2C%20UnitPrice%2C%20ProdCode%2CShipLineComplete%2C%20TotalReleases%2C%20LineStatus%2C%20TotalPrice%2C%20CustNumCustID%2C%20PartNumSalesUM%2C%20JobCode_c%2C%20JobID_c%20

And this one will not give me the seperate release for a line:

https://my server/ERP101500/api/v1/Erp.BO.SalesOrderSvc/OrderRels(VT,372982,1,3)?%24select=OrderNum%2C%20OrderLine%2C%20OrderRelNum%2C%20ShipToNum%2C%20ShipViaCode%2C%20ShipViaCodeDescription%2C%20OurJobQty%2C%20ShipToAddressList%2C%20ShipToContactName%2C%20

Is this how it works or what am I missing?

your first and second ones are exactly the same.

Sorry, fixed to what I actually had.

so I’m working on recreating what you are doing in swagger (because I am learning right along with you) and the last one returns something using all of your selects, so I don’t see any typos. I need to try one with more that one release though (I have it filtered by one order that has only one release)

Are you sure that the order you are looking at has more than one release?

Yes, line one has two releases, line two has 1 release, line three has one release.

interesting, if I use one order number it returns a set like I would expect.

If I use a different one, the whole set is empty.

image

Is that what you are seeing?

I haven’t tried a different order number yet, but what I am seeing is it returns only line 1 when I am calling for line 2.

on the last one, the third number is the specific release number isn’t it?

image

Yes. You are correct. But it only pulls the 1st release not the 3rd.

I don’t want to discount the fact that this is exploratory and educational, which is good, but for production, you may want to go the BAQ route and use the BaqSvc. That way, the interface is constant and selection is done through parameters that are more “URL-Like”. Also you’re only downloading the data you need and not serializing the whole record.

Mark W.

1 Like

so I don’t have any with multiple releases, but when I put in the different orderline numbers is always returns the last line…

I am looking to tie in third party shipping software via REST. So, this is a little more than educational.
I’m a little lost. What do you mean by “not serializing the whole record?” I was thinking the BAQ route would be best but the software company says REST is best.

You can use rest to call a BAQ.

1 Like

I mean that you can call BAQs from REST. The BAQ allows you to reformat your data to the exact specifications that the software company wants. You can pass in parameters to select the orders/lines/releases that you want too.

Mark W.

1 Like

Yeah, that’s what I meant as well. But just for the record, going back to pulling via REST without the BAQ, will it not pull down the correct release or line when it is specified?

Might be a bug. The individual Object calls may not be as…umm…solid just yet. You may have uncovered an issue to report. But the BAQ service is pretty tight because it gets used a lot.

Mark W.

in 10.2 it seems to work as expected (I have different order lines, but not different releases). It seems them must have fixed something. In postman I set up the different environments and can pop back and forth and they return different things with the same call.

Let me add a release to something. Give me a few minutes :wink:

1 Like

Well, I am on 10.1.500.38. @Banderson can you create an order with more than one release to check it on 10.2? I do not want to jump to that, but I may have to if it works. Otherwise we will go with the BAQ.

it works correctly in 10-2. This is using Postman, but it was copied out of swagger to start with. I added the part number so that I could make sure I was on the right line.

{{Host}}/api/v1/Erp.BO.SalesOrderSvc/OrderRels(Rapat,402825,1,2)?%24select=OrderNum%2C%20OrderLine%2C%20OrderRelNum%2C%20ShipToNum%2C%20ShipViaCode%2C%20ShipViaCodeDescription%2C%20OurJobQty%2C%20ShipToAddressList%2C%20ShipToContactName%2C%20%20PartNum%2C

and just to reiterate, it does not! work correctly in 10.1.600.

2 Likes

Well, that answers it for me! 10.1.500.38 just sucks comared to 10.2 :joy::sweat_smile::sweat_smile: