Door deze website te bezoeken maak je automatisch gebruik van cookies.

Als de browser instellingen niet veranderd, dan maak je gebruik van de cookies. Lees meer

Sluiten

2BA Cookie informatie

Deze tekst is van toepassing op de 2BA sites "Homepage", "Unifeed" en "Bestand & Beheer".

Wat is een Cookie

Wij maken op deze website gebruik van cookies. Een cookie is een eenvoudig klein bestandje dat met pagina’s van deze website wordt meegestuurd en door uw browser op uw harde schrijf van uw computer wordt opgeslagen.

Soort cookies

Wij gebruiken cookies om het gebruik van onze site faciliteren, het inloggen te onthouden en t.b.v. snelheidsverbeteringen. Daarnaast gebruiken wij (anonieme) gegevens voor het opbouwen van site statistieken zoals het aantal keer dat de sites bezocht worden, met welke browser etc. De 2BA site kan niet zonder cookies werken. 

2BA maakt geen gebruik van tracking cookies t.b.v. advertenties.

 

 

Documentatie

With the JSONPOST interface type, details of the selected item(s) are posted from the client (browser) to the URL specified via the hookUrl parameter.

After importing the items, the details of, for example, the article, can be retrieved using the web service "TradeItem/DetailsByGLNAndTradeItemId"

Interfaces

Article, Selection list, Product

Action POST the result to the specified hookUrl (fire-and-forget, no feedback within Unifeed), from the Client
Content 2BA JSON containing one or more articles
Example opening Unifeed https://unifeed.2ba.nl/?interfaceType=JSONPOST&interface=3&hookUrl=http://www.mycompany.com/receive2BA.aspx
Example response For articles 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"
}]
Voor product:
[{
	"ProductId":"56354b44-b01b-4f75-8ddf-c1defe1edf0b",
	"Description":"ALPHA2 25-40 130 1x230V 50Hz 6H"
}]

CORS

With the interfaceType=JSONPOST the POST is executed in the background from the client (browser).
Using this method, the customer remains on the current page in Unifeed. No navigation takes place.
The session, complete with all filters etc. remains intact.

A client-side post was chosed because it allows the use of internal/local IP addresses.
Another advantage is that this method (usually) does not require any firewall adjustments.

POSTing from the client, howerver, involves CORS (https://en.wikipedia.org/wiki/Cross-origin_resource_sharing).
The receiving application needs to accept the browser's POST.
This is achieved via a so-called preflight; First, an OPTIONS request is sent, specifying Unifeed as Origin.
The application should respond to this options request by suppliying an "Access-Control-Allow-Origin" header, containing the Unifeed website as specified in the OPTIONS request.
Only if this response makes it back to the browser will the true POST request take place.

Interface=JSON makes a direct POST, which does not involve CORS.

 

Testing using PostServer.com

By using "postserver.com", the post request can be tested easily:
https://unifeed.2ba.nl/?interfaceType=JSONPOST&interface=3&hookUrl=http://posttestserver.com/post.php?dir=EIGENCODE

After the post, the directory below will contain a file containing the contents of the POST.
http://posttestserver.com/data/2016/01/22/EIGENCODE (replace the date with today's date)