{"id":21392,"date":"2021-02-19T15:30:33","date_gmt":"2021-02-19T13:30:33","guid":{"rendered":"https:\/\/www.triangle.es\/how-to-use-an-api-in-dynamics-365-business-central\/"},"modified":"2024-05-21T11:22:35","modified_gmt":"2024-05-21T11:22:35","slug":"how-to-use-an-api-in-dynamics-365-business-central","status":"publish","type":"post","link":"https:\/\/triangle.desarrollobirdcom.es\/en\/sin-categorizar\/how-to-use-an-api-in-dynamics-365-business-central\/","title":{"rendered":"How to use an API in Dynamics 365 Business Central?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In basic terms, APIs just allow applications to communicate with each other. When people talk about <strong>&#8220;API&#8221;, they sometimes generalize and really mean &#8220;a publicly available web-based API that returns data, probably in JSON or XML&#8221;<\/strong>. The API is not the database, or even the server, but the code that governs the access points to the server. Let&#8217;s look at it in more detail<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Imagine the following scenario: you want to access the data or functionality of another application. Perhaps you want to extract data for analysis or use it in other software<\/strong>. Then you would have to find a way to import that spreadsheet into your application; and, even if you stored it in a database, the data would become out of date very quickly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It would be better and easier to have a way to query the application for that data, so that you could view it or use it in your own application automatically. <strong>In this way, it would be kept up to date automatically<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>An API makes it easy for a different application to provide functionality or access to the data<\/strong>, so the data can be included in different applications.<\/p>\n\n\n\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/triangle.desarrollobirdcom.es\/en\/sin-categorizar\/how-to-use-an-api-in-dynamics-365-business-central\/#What_is_an_API\" >What is an API?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/triangle.desarrollobirdcom.es\/en\/sin-categorizar\/how-to-use-an-api-in-dynamics-365-business-central\/#What_can_we_say_about_Business_Centrals_APIs\" >What can we say about Business Central&#8217;s APIs?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/triangle.desarrollobirdcom.es\/en\/sin-categorizar\/how-to-use-an-api-in-dynamics-365-business-central\/#First_steps_to_work_with_APIs_in_Business_Central\" >First steps to work with APIs in Business Central<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/triangle.desarrollobirdcom.es\/en\/sin-categorizar\/how-to-use-an-api-in-dynamics-365-business-central\/#Connecting_Business_Central_and_Power_Platform\" >Connecting Business Central and Power Platform<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_an_API\"><\/span>What is an API?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">An <strong>API (Application Programming Interface) is a tool that allows two different programs to communicate<\/strong>. In this case, Microsoft has published certain Web API or Web Services to communicate Business Central with third-party tools, always taking advantage of code that is already tested and works correctly. There is no need to carry out specific developments for each client&#8217;s connections.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The fact that Microsoft has defined the APIs means that they are now available to Business Central&#8217;s end users, and not just to its developers. <strong>The technical teams are focusing on developing data connectors so that end users can more easily access the data<\/strong> stored in the system while guaranteeing all security standards.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_can_we_say_about_Business_Centrals_APIs\"><\/span>What can we say about Business Central&#8217;s APIs?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The APIs offered by Business Central allow you to consume and <strong>connect your ERP data to other tools, such as Excel, Power BI or Power Platform (Power Automate and Power Apps)<\/strong>. You can also use them to connect Business Central to third party tools that are not related to Microsoft, for fast and secure data exchange.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the following, we will show <strong>examples of how to work with Business Central APIs in Excel, Power BI and Power Platform.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"First_steps_to_work_with_APIs_in_Business_Central\"><\/span>First steps to work with APIs in Business Central<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When we want to start working with this type of connections, one of the first questions we will ask ourselves is: <strong>Where do I find the data I need?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>In the &#8216;Web Services&#8217; page of Business Central you will find a list of available Web Services<\/strong>. You will have to identify which option in the list contains the information you need. Remember that you can rely on our infrastructure support team for this task.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"899\" height=\"506\" src=\"https:\/\/triangle.desarrollobirdcom.es\/wp-content\/uploads\/2021\/02\/bc-api-1.png\" alt=\"\" class=\"wp-image-21369\" srcset=\"https:\/\/triangle.desarrollobirdcom.es\/wp-content\/uploads\/2021\/02\/bc-api-1.png 899w, https:\/\/triangle.desarrollobirdcom.es\/wp-content\/uploads\/2021\/02\/bc-api-1-300x169.png 300w, https:\/\/triangle.desarrollobirdcom.es\/wp-content\/uploads\/2021\/02\/bc-api-1-768x432.png 768w\" sizes=\"auto, (max-width: 899px) 100vw, 899px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Note that the URL contains information about the company and also about the page you are using.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>When you have identified which option is the most convenient, you will have to copy the URL to insert the information in the corresponding tools<\/strong>. For example, let&#8217;s look at the case of Excel.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, let&#8217;s insert the data:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"554\" height=\"397\" src=\"https:\/\/triangle.desarrollobirdcom.es\/wp-content\/uploads\/2021\/02\/bc-api-2.png\" alt=\"\" class=\"wp-image-21371\" srcset=\"https:\/\/triangle.desarrollobirdcom.es\/wp-content\/uploads\/2021\/02\/bc-api-2.png 554w, https:\/\/triangle.desarrollobirdcom.es\/wp-content\/uploads\/2021\/02\/bc-api-2-300x215.png 300w\" sizes=\"auto, (max-width: 554px) 100vw, 554px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">We will need to copy the link provided by Business Central in Excel to continue. You can then proceed anonymously or by logging in to your organizational account, depending on how the API is configured.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you have passed this point, <strong>you will have access to the data contained in this API and it is time to take advantage of the power of Excel<\/strong> to work with the data using graphs, dynamic tables, dashboards, etc.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On the other hand, if we want to <strong>connect Business Central data from Power BI,<\/strong> we will have to perform a slightly different process, since as a source of data entry will already offer us the option to choose &#8220;Dynamics 365 Business Central&#8221;.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Connecting_Business_Central_and_Power_Platform\"><\/span>Connecting Business Central and Power Platform<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, we are going to exemplify <strong>how to connect Business Central data with the tools that make up the Power Platform<\/strong>. Business Central has its own specific standard connectors for these platforms (Power Automate and Power Apps). These connectors allow you to extract data as well as send data to Business Central.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In addition, you can select the API endpoints you need. API endpoints are the different types of data you can work with from Business Central.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"327\" height=\"307\" src=\"https:\/\/triangle.desarrollobirdcom.es\/wp-content\/uploads\/2021\/02\/bc-api-3.png\" alt=\"\" class=\"wp-image-21373\" srcset=\"https:\/\/triangle.desarrollobirdcom.es\/wp-content\/uploads\/2021\/02\/bc-api-3.png 327w, https:\/\/triangle.desarrollobirdcom.es\/wp-content\/uploads\/2021\/02\/bc-api-3-300x282.png 300w\" sizes=\"auto, (max-width: 327px) 100vw, 327px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">In the case of Power Automate, for example, you also have predefined some of the triggers that initiate a flow.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"1233\" height=\"292\" src=\"https:\/\/triangle.desarrollobirdcom.es\/wp-content\/uploads\/2021\/02\/bc-api-4.png\" alt=\"\" class=\"wp-image-21375\" srcset=\"https:\/\/triangle.desarrollobirdcom.es\/wp-content\/uploads\/2021\/02\/bc-api-4.png 1233w, https:\/\/triangle.desarrollobirdcom.es\/wp-content\/uploads\/2021\/02\/bc-api-4-300x71.png 300w, https:\/\/triangle.desarrollobirdcom.es\/wp-content\/uploads\/2021\/02\/bc-api-4-1024x243.png 1024w, https:\/\/triangle.desarrollobirdcom.es\/wp-content\/uploads\/2021\/02\/bc-api-4-768x182.png 768w\" sizes=\"auto, (max-width: 1233px) 100vw, 1233px\" \/><\/figure>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>In basic terms, APIs just allow applications to communicate with each other. When people talk about &#8220;API&#8221;, they sometimes generalize &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to use an API in Dynamics 365 Business Central?\" class=\"read-more button\" href=\"https:\/\/triangle.desarrollobirdcom.es\/en\/sin-categorizar\/how-to-use-an-api-in-dynamics-365-business-central\/#more-21392\" aria-label=\"Read more about How to use an API in Dynamics 365 Business Central?\">LEER M\u00c1S<\/a><\/p>\n","protected":false},"author":1,"featured_media":21389,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-21392","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sin-categorizar","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"_links":{"self":[{"href":"https:\/\/triangle.desarrollobirdcom.es\/en\/wp-json\/wp\/v2\/posts\/21392","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/triangle.desarrollobirdcom.es\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/triangle.desarrollobirdcom.es\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/triangle.desarrollobirdcom.es\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/triangle.desarrollobirdcom.es\/en\/wp-json\/wp\/v2\/comments?post=21392"}],"version-history":[{"count":1,"href":"https:\/\/triangle.desarrollobirdcom.es\/en\/wp-json\/wp\/v2\/posts\/21392\/revisions"}],"predecessor-version":[{"id":26959,"href":"https:\/\/triangle.desarrollobirdcom.es\/en\/wp-json\/wp\/v2\/posts\/21392\/revisions\/26959"}],"wp:attachment":[{"href":"https:\/\/triangle.desarrollobirdcom.es\/en\/wp-json\/wp\/v2\/media?parent=21392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/triangle.desarrollobirdcom.es\/en\/wp-json\/wp\/v2\/categories?post=21392"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/triangle.desarrollobirdcom.es\/en\/wp-json\/wp\/v2\/tags?post=21392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}