Text only available in english
With interfaceType=JSON the following flows are possible:
When importing one or more articles, navigation to /interface/JSON takes place, placing the details of the selected item(s) in the body. Navigation to /interface/JSON can be monitored / read by using a browser embedded in the appliction. After this trigger, the body can be parsed and processed further.
When importing one or more articles, the JSON is POSTed to the specified hookUrl. This is a normal FORM-POST. The JSON message is supplied in a form-field named “Json”.
Interfaces |
Article, Selection list, Product |
---|---|
Action | REDIRECT to /interface/JSON (for article (1) and selection list (2) interface) REDIRECT to /interface/ProductJSON (for product (4) interface) |
Content | 2BA JSON containing one or more articles |
Example opening Unifeed | https://unifeed.2ba.nl/?interfaceType=JSON&interface=3 https://unifeed.2ba.nl/?interfaceType=JSON&interface=3&hookUrl=https://www.posttestserver.com/my2batest |
Example response | For article and selection list:
[{ "SupplierGLN":"8712423008724", "SupplierName":"Grundfos Nederland", "SuppliersTradeItemId":"97993195", "PricePerOrderUnit":"319.00", "Method":"OriginalGrossPrice", "Quantity":"2" },{ "SupplierGLN":"8711389000001", "SupplierName":"Technische Unie", "SuppliersTradeItemId":"1649593", "PricePerOrderUnit":"1.75", "Method":"DiscountArticlePercentage", "Quantity":"10" }] For product: [{ "ProductId":"56354b44-b01b-4f75-8ddf-c1defe1edf0b", "Description":"ALPHA2 25-40 130 1x230V 50Hz 6H" }] |
Example code | Example “JSON” interface, parsing from embedded browser
using System.Windows.Navigation; private void UnifeedBrowser_Navigated(object sender, NavigationEventArgs e) { if (e.Uri==null || e.Uri.LocalPath != "/interface/JSON") { return; } // In standard Forms applications: webBrowser.DocumentText var jsondata = ((mshtml.HTMLDocumentClass)this.UnifeedBrowser.Document).body.innerHTML; |
After importing the items, the associated details can be retrieved using the “Product /DetailsByGLNAndTradeItemCodeA” web service.