Page 1 of 2

API - BookIn

PostPosted: Sat Jun 30, 2018 1:00 pm
by Riyaz
Hi

Need some help finding the api details for BookIn related functions, such as creating new BookIn etc, I couldnt find any reference under this api link http://myjiwaapi/swagger-ui/

Re: API - BookIn

PostPosted: Sat Jun 30, 2018 1:08 pm
by Mike.Sheen
Hi Riyaz,

We only added book-ins and shipments to the api recently - so dev builds from 07.01.01 onwards will have them - you can get a dev build from the Development Stream tab of our downloads page.

If you just want to take a look without installing anything, then https://api.jiwa.com.au is our demo site on the latest dev build - the SwaggerUI there will show the BookIns routes. You can play with this yourself - the username Admin with password of password should be used for authentication.

Mike

Re: API - BookIn

PostPosted: Sat Jun 30, 2018 2:09 pm
by Riyaz
Hi Mike

Thanks for the quick response, can you pls also advise I. When this build will be released to the public version.

Re: API - BookIn

PostPosted: Sat Jun 30, 2018 5:47 pm
by Mike.Sheen
Riyaz wrote:Thanks for the quick response, can you pls also advise I. When this build will be released to the public version.


I can't give you an exact date, but I expect to to be within the next 2 or 3 weeks.

Mike

Re: API - BookIn

PostPosted: Tue Jul 03, 2018 12:13 pm
by Riyaz
Hi Mike

Have updated or jiwa to version 7.01.05, but the api swagger wont show the BookIn still like it does on the api.jiwa.com.au link , is there anything else to be done to activate it? Pls advise

Re: API - BookIn

PostPosted: Tue Jul 03, 2018 12:52 pm
by Mike.Sheen
The first thing which comes to mind is If you're using your own copy of the REST API plugin, then we don't touch that when a database is upgraded - we only update our standard REST API plugin code - so if that plugin is not enabled then the new routes won't appear.

Is our standard REST API Plugin enabled in your database? Or are you using your own version/copy?

Re: API - BookIn

PostPosted: Tue Jul 03, 2018 1:23 pm
by Riyaz
Yes using REST API, noticed that it got disabled after upgrade, had enabled it again, and have also restarted the service. But still the BookIns wont show under auth in Swagger like it does for api.jiwa.com.au link. Pls see screenshots attached

Re: API - BookIn

PostPosted: Tue Jul 03, 2018 1:24 pm
by Mike.Sheen
Can you show me the plugin maintenance form with the REST API plugin loaded?

Re: API - BookIn

PostPosted: Tue Jul 03, 2018 1:30 pm
by Riyaz
Have attached it

Re: API - BookIn

PostPosted: Tue Jul 03, 2018 1:47 pm
by Mike.Sheen
Ok - can you look around line 1395 in the code of that plugin, you should see a block of code like this:

Code: Select all
#region "Landed Cost"
   #region "BookIns"
      #region "{Main}"
         AppHost.RegisterService<LandedCostBookInServices>();
         AppHost.Routes.Add(typeof(LandedCostBookInGETRequest), "/BookIns/{BookInID}", "GET", "Retrieves a book in.", "");
         AppHost.Routes.Add(typeof(LandedCostBookInPATCHRequest), "/BookIns/{BookInID}", "PATCH", "Updates a book in.", "");
         AppHost.Routes.Add(typeof(LandedCostBookInSAVERequest), "/BookIns/Save", "GET", "Saves a stateful book in.", "Requires a request header of 'jiwa-stateful' be set to 'true', and also that a stateful book in item exists.");
         AppHost.Routes.Add(typeof(LandedCostBookInABANDONRequest), "/BookIns/Abandon", "DELETE", "Abandons a stateful book in.", "Requires a request header of 'jiwa-stateful' be set to 'true', and also that a stateful book in item exists.");
         AppHost.Routes.Add(typeof(LandedCostBookInCREATEFromShipmentIDRequest), "/BookIns/FromShipmentID/{ShipmentID}", "POST", "Creates a book in from the supplied shipment id.", "");
         AppHost.Routes.Add(typeof(LandedCostBookInCREATEFromShipmentNoRequest), "/BookIns/FromShipmentNo/{ShipmentNo}", "POST", "Creates a book in from the supplied shipment no.", "");
         AppHost.Routes.Add(typeof(LandedCostBookInACTIVATERequest), "/BookIns/Activate/{BookInID}", "POST", "Activates a book in.", "");
      #endregion


Do you see that? Where it's adding the bookin routes?