{"id":2550,"date":"2023-07-10T13:22:13","date_gmt":"2023-07-10T13:22:13","guid":{"rendered":"https:\/\/www.2ba.nl\/?p=2550"},"modified":"2023-07-10T13:22:43","modified_gmt":"2023-07-10T13:22:43","slug":"jsonpost","status":"publish","type":"post","link":"https:\/\/2ba.wimwillems.nl\/en\/documentation\/unifeed\/interfaces\/jsonpost\/","title":{"rendered":"JSONPOST"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">Interfaces &#8211; JSONPOST<\/h1>\n\n\n<p>Text only available in english<\/p>\n<p>With the JSONPOST interface type, details of the selected item(s)\u00a0are posted from the <span style=\"text-decoration: underline;\">client (browser)<\/span> to the URL specified via the hookUrl parameter.<\/p>\n<p>After importing the items, the details of, for example, the article, can be retrieved using the web service <a title=\"&quot;TradeItem\/DetailsByGLNAndTradeItemIdA&quot;\" href=\"https:\/\/api.2ba.nl\/1\/docs\/index.html?url=\/1\/docs\/swagger.json#\/TradeItem\/RESTServices.TradeItem.GetDetailsByGLNAndTradeItemIdA\">&#8220;TradeItem\/DetailsByGLNAndTradeItemIdA&#8221;<\/a><\/p>\n<table class=\"table table-striped table-bordered\">\n<tbody>\n<tr>\n<th style=\"width: 25%;\">Interfaces<\/th>\n<td>\n<p>Article, Selection list, Product<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>Action<\/th>\n<td>POST the result to the specified hookUrl (fire-and-forget, no feedback within Unifeed), from the Client<\/td>\n<\/tr>\n<tr>\n<th>Content<\/th>\n<td>2BA JSON containing one or more articles<\/td>\n<\/tr>\n<tr>\n<th>Example opening Unifeed<\/th>\n<td>https:\/\/unifeed.2ba.nl\/?interfaceType=JSONPOST&amp;interface=3&amp;hookUrl=http:\/\/www.mycompany.com\/receive2BA.aspx<\/td>\n<\/tr>\n<tr>\n<th>Example response<\/th>\n<td>For articles and selection list:\n<p>\u00a0<\/p>\n<pre class=\"brush:js\">[{\n\t\"SupplierGLN\":\"8712423008724\",\n\t\"SupplierName\":\"Grundfos Nederland\",\n\t\"SuppliersTradeItemId\":\"97993195\",\n\t\"PricePerOrderUnit\":\"319.00\",\n\t\"Method\":\"OriginalGrossPrice\",\n\t\"Quantity\":\"2\"\n},{\n\t\"SupplierGLN\":\"8711389000001\",\n\t\"SupplierName\":\"Technische Unie\",\n\t\"SuppliersTradeItemId\":\"1649593\",\n\t\"PricePerOrderUnit\":\"1.75\",\n\t\"Method\":\"DiscountArticlePercentage\",\n\t\"Quantity\":\"10\"\n}]\n<\/pre>\n<p>Voor product:<\/p>\n<pre class=\"brush:js\">[{\n\t\"ProductId\":\"56354b44-b01b-4f75-8ddf-c1defe1edf0b\",\n\t\"Description\":\"ALPHA2 25-40 130 1x230V 50Hz 6H\"\n}]\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>CORS<\/h3>\n<p>With the interfaceType=JSONPOST the POST is executed in the background from the client (browser).<br \/>Using this method, the customer remains on the current page in Unifeed. No navigation takes place. <br \/>The session, complete with all filters etc. remains intact.<\/p>\n<p>A client-side post was chosed because it allows the use of internal\/local IP addresses.<br \/>Another advantage is that this method (usually) does not require any firewall adjustments.<\/p>\n<p>POSTing from the client, howerver, involves CORS (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Cross-origin_resource_sharing\">https:\/\/en.wikipedia.org\/wiki\/Cross-origin_resource_sharing<\/a>).<br \/>The receiving application needs to accept the browser&#8217;s POST.<br \/>This is achieved via a so-called preflight; First, an OPTIONS request is sent, specifying Unifeed as Origin.<br \/>The application should respond to this options request by suppliying an &#8220;Access-Control-Allow-Origin&#8221; header, containing the Unifeed website as specified in the OPTIONS request.<br \/>Only if this response makes it back to the browser will the true POST request take place.<\/p>\n<p><a href=\"\/documentatie\/unifeed\/interfaces\/json\">Interface=JSON<\/a> makes a direct POST, which does not involve CORS.<\/p>\n<h3>Testing using webhook.site<\/h3>\n<p>To use the JSONPOST, the receiving server must have CORS enabled and your URL(s) specified at 2BA in Policies:connect-src and frame-ancestors. By using &#8221; webhook.site &#8220;, the post request can be tested easily, example URL: <br \/><a title=\"https:\/\/unifeed.2ba.nl\/?interfaceType=JSONPOST&amp;interface=3&amp;hookUrl=https:\/\/webhook.site\/88b15f6f-12a6-4df0-8a09-f0cb6c0085d2\/?list_a=DATE\" href=\"https:\/\/unifeed.2ba.nl\/?interfaceType=JSONPOST&amp;interface=3&amp;hookUrl=https:\/\/webhook.site\/88b15f6f-12a6-4df0-8a09-f0cb6c0085d2\/?list_a=DATE\" target=\"_blank\" rel=\"noopener\">https:\/\/unifeed.2ba.nl\/?interfaceType=JSONPOST&amp;interface=3&amp;hookUrl=https:\/\/webhook.site\/88b15f6f-12a6-4df0-8a09-f0cb6c0085d2\/?list_a=DATE<\/a> <br \/>After the post, the directory below will contain a file containing the contents of the POST.<br \/><a href=\"https:\/\/webhook.site\/#!\/88b15f6f-12a6-4df0-8a09-f0cb6c0085d2\" target=\"_blank\" rel=\"noopener\">https:\/\/webhook.site\/#!\/88b15f6f-12a6-4df0-8a09-f0cb6c0085d2<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>Interfaces &#8211; JSONPOST Text only available in english With the JSONPOST interface type, details of the selected item(s)\u00a0are 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 &#8220;TradeItem\/DetailsByGLNAndTradeItemIdA&#8221; Interfaces Article, Selection list, Product [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","footnotes":""},"categories":[113],"tags":[],"class_list":["post-2550","post","type-post","status-publish","format-standard","hentry","category-interfaces-en"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>JSONPOST - 2ba<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/2ba.wimwillems.nl\/en\/documentation\/unifeed\/interfaces\/jsonpost\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JSONPOST - 2ba\" \/>\n<meta property=\"og:description\" content=\"Interfaces &#8211; JSONPOST Text only available in english With the JSONPOST interface type, details of the selected item(s)\u00a0are 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 &#8220;TradeItem\/DetailsByGLNAndTradeItemIdA&#8221; Interfaces Article, Selection list, Product [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/2ba.wimwillems.nl\/en\/documentation\/unifeed\/interfaces\/jsonpost\/\" \/>\n<meta property=\"og:site_name\" content=\"2ba\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-10T13:22:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-10T13:22:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/2ba.wimwillems.nl\/wp-content\/uploads\/2023\/06\/2BA_logo_RGB.png\" \/>\n\t<meta property=\"og:image:width\" content=\"211\" \/>\n\t<meta property=\"og:image:height\" content=\"95\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"2ba\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"2ba\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/2ba.wimwillems.nl\/en\/documentation\/unifeed\/interfaces\/jsonpost\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/2ba.wimwillems.nl\/en\/documentation\/unifeed\/interfaces\/jsonpost\/\"},\"author\":{\"name\":\"2ba\",\"@id\":\"https:\/\/2ba.wimwillems.nl\/#\/schema\/person\/e38a7da4ab5c525bc5ff65c2f9f29412\"},\"headline\":\"JSONPOST\",\"datePublished\":\"2023-07-10T13:22:13+00:00\",\"dateModified\":\"2023-07-10T13:22:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/2ba.wimwillems.nl\/en\/documentation\/unifeed\/interfaces\/jsonpost\/\"},\"wordCount\":373,\"commentCount\":0,\"articleSection\":[\"Interfaces\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/2ba.wimwillems.nl\/en\/documentation\/unifeed\/interfaces\/jsonpost\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/2ba.wimwillems.nl\/en\/documentation\/unifeed\/interfaces\/jsonpost\/\",\"url\":\"https:\/\/2ba.wimwillems.nl\/en\/documentation\/unifeed\/interfaces\/jsonpost\/\",\"name\":\"JSONPOST - 2ba\",\"isPartOf\":{\"@id\":\"https:\/\/2ba.wimwillems.nl\/#website\"},\"datePublished\":\"2023-07-10T13:22:13+00:00\",\"dateModified\":\"2023-07-10T13:22:43+00:00\",\"author\":{\"@id\":\"https:\/\/2ba.wimwillems.nl\/#\/schema\/person\/e38a7da4ab5c525bc5ff65c2f9f29412\"},\"breadcrumb\":{\"@id\":\"https:\/\/2ba.wimwillems.nl\/en\/documentation\/unifeed\/interfaces\/jsonpost\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/2ba.wimwillems.nl\/en\/documentation\/unifeed\/interfaces\/jsonpost\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/2ba.wimwillems.nl\/en\/documentation\/unifeed\/interfaces\/jsonpost\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/2ba.wimwillems.nl\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JSONPOST\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/2ba.wimwillems.nl\/#website\",\"url\":\"https:\/\/2ba.wimwillems.nl\/\",\"name\":\"2ba\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/2ba.wimwillems.nl\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/2ba.wimwillems.nl\/#\/schema\/person\/e38a7da4ab5c525bc5ff65c2f9f29412\",\"name\":\"2ba\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/98fd787799f599e7136207ddae02d3ff6c5d346317929a6e3bac964389f20320?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/98fd787799f599e7136207ddae02d3ff6c5d346317929a6e3bac964389f20320?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/98fd787799f599e7136207ddae02d3ff6c5d346317929a6e3bac964389f20320?s=96&d=mm&r=g\",\"caption\":\"2ba\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JSONPOST - 2ba","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/2ba.wimwillems.nl\/en\/documentation\/unifeed\/interfaces\/jsonpost\/","og_locale":"en_US","og_type":"article","og_title":"JSONPOST - 2ba","og_description":"Interfaces &#8211; JSONPOST Text only available in english With the JSONPOST interface type, details of the selected item(s)\u00a0are 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 &#8220;TradeItem\/DetailsByGLNAndTradeItemIdA&#8221; Interfaces Article, Selection list, Product [&hellip;]","og_url":"https:\/\/2ba.wimwillems.nl\/en\/documentation\/unifeed\/interfaces\/jsonpost\/","og_site_name":"2ba","article_published_time":"2023-07-10T13:22:13+00:00","article_modified_time":"2023-07-10T13:22:43+00:00","og_image":[{"width":211,"height":95,"url":"https:\/\/2ba.wimwillems.nl\/wp-content\/uploads\/2023\/06\/2BA_logo_RGB.png","type":"image\/png"}],"author":"2ba","twitter_card":"summary_large_image","twitter_misc":{"Written by":"2ba","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/2ba.wimwillems.nl\/en\/documentation\/unifeed\/interfaces\/jsonpost\/#article","isPartOf":{"@id":"https:\/\/2ba.wimwillems.nl\/en\/documentation\/unifeed\/interfaces\/jsonpost\/"},"author":{"name":"2ba","@id":"https:\/\/2ba.wimwillems.nl\/#\/schema\/person\/e38a7da4ab5c525bc5ff65c2f9f29412"},"headline":"JSONPOST","datePublished":"2023-07-10T13:22:13+00:00","dateModified":"2023-07-10T13:22:43+00:00","mainEntityOfPage":{"@id":"https:\/\/2ba.wimwillems.nl\/en\/documentation\/unifeed\/interfaces\/jsonpost\/"},"wordCount":373,"commentCount":0,"articleSection":["Interfaces"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/2ba.wimwillems.nl\/en\/documentation\/unifeed\/interfaces\/jsonpost\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/2ba.wimwillems.nl\/en\/documentation\/unifeed\/interfaces\/jsonpost\/","url":"https:\/\/2ba.wimwillems.nl\/en\/documentation\/unifeed\/interfaces\/jsonpost\/","name":"JSONPOST - 2ba","isPartOf":{"@id":"https:\/\/2ba.wimwillems.nl\/#website"},"datePublished":"2023-07-10T13:22:13+00:00","dateModified":"2023-07-10T13:22:43+00:00","author":{"@id":"https:\/\/2ba.wimwillems.nl\/#\/schema\/person\/e38a7da4ab5c525bc5ff65c2f9f29412"},"breadcrumb":{"@id":"https:\/\/2ba.wimwillems.nl\/en\/documentation\/unifeed\/interfaces\/jsonpost\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/2ba.wimwillems.nl\/en\/documentation\/unifeed\/interfaces\/jsonpost\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/2ba.wimwillems.nl\/en\/documentation\/unifeed\/interfaces\/jsonpost\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/2ba.wimwillems.nl\/en\/"},{"@type":"ListItem","position":2,"name":"JSONPOST"}]},{"@type":"WebSite","@id":"https:\/\/2ba.wimwillems.nl\/#website","url":"https:\/\/2ba.wimwillems.nl\/","name":"2ba","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/2ba.wimwillems.nl\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/2ba.wimwillems.nl\/#\/schema\/person\/e38a7da4ab5c525bc5ff65c2f9f29412","name":"2ba","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/98fd787799f599e7136207ddae02d3ff6c5d346317929a6e3bac964389f20320?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/98fd787799f599e7136207ddae02d3ff6c5d346317929a6e3bac964389f20320?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/98fd787799f599e7136207ddae02d3ff6c5d346317929a6e3bac964389f20320?s=96&d=mm&r=g","caption":"2ba"}}]}},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"gform-image-choice-sm":false,"gform-image-choice-md":false,"gform-image-choice-lg":false},"uagb_author_info":{"display_name":"2ba","author_link":"https:\/\/2ba.wimwillems.nl\/en\/author\/2ba\/"},"uagb_comment_info":0,"uagb_excerpt":"Interfaces &#8211; JSONPOST Text only available in english With the JSONPOST interface type, details of the selected item(s)\u00a0are 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 &#8220;TradeItem\/DetailsByGLNAndTradeItemIdA&#8221; Interfaces Article, Selection list, Product&hellip;","_links":{"self":[{"href":"https:\/\/2ba.wimwillems.nl\/en\/wp-json\/wp\/v2\/posts\/2550","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/2ba.wimwillems.nl\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2ba.wimwillems.nl\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2ba.wimwillems.nl\/en\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/2ba.wimwillems.nl\/en\/wp-json\/wp\/v2\/comments?post=2550"}],"version-history":[{"count":1,"href":"https:\/\/2ba.wimwillems.nl\/en\/wp-json\/wp\/v2\/posts\/2550\/revisions"}],"predecessor-version":[{"id":2551,"href":"https:\/\/2ba.wimwillems.nl\/en\/wp-json\/wp\/v2\/posts\/2550\/revisions\/2551"}],"wp:attachment":[{"href":"https:\/\/2ba.wimwillems.nl\/en\/wp-json\/wp\/v2\/media?parent=2550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2ba.wimwillems.nl\/en\/wp-json\/wp\/v2\/categories?post=2550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2ba.wimwillems.nl\/en\/wp-json\/wp\/v2\/tags?post=2550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}