Interfaces – JSON

Text only available in english

With interfaceType=JSON the following flows are possible:

  • without hookUrl
  • with hookUrl

Without hookUrl

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.

With hookUrl

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”.

Details van de interface

InterfacesArticle, Selection list, Product
ActionREDIRECT to /interface/JSON (for article (1) and selection list (2) interface)
REDIRECT to /interface/ProductJSON (for product (4) interface)
Content2BA JSON containing one or more articles
Example opening Unifeedhttps://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: “JSON” interface, parsing from embedded browser

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.

Wat biedt 2BA voor u als Installateur Wat biedt 2BA voor u als Groothandel Wat biedt 2BA voor u als Fabrikant Wat biedt 2BA voor u als Software Partner
This site is registered on wpml.org as a development site.