<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Microsoft Dynamic 365 business Central API data fetch using Fabric note book in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Microsoft-Dynamic-365-business-Central-API-data-fetch-using/m-p/4764841#M10947</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317253" data-lia-user-login="kasun_rumesh" class="lia-mention lia-mention-user"&gt;kasun_rumesh&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;The Client Credentials Flow is ideal for non-interactive scenarios like Fabric notebooks. It allows your script to get an access token using just the Tenant ID, Client ID, and Client Secret, without needing user login. This is done by calling Azure AD's token endpoint with the appropriate parameters. Make sure your Azure AD app has the necessary application-level API permissions (e.g., Financials.ReadWrite.All) and that admin consent has been granted. Once the token is received, you can use it to call the Business Central API.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Wed, 16 Jul 2025 07:51:18 GMT</pubDate>
    <dc:creator>v-venuppu</dc:creator>
    <dc:date>2025-07-16T07:51:18Z</dc:date>
    <item>
      <title>Microsoft Dynamic 365 business Central API data fetch using Fabric note book</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Microsoft-Dynamic-365-business-Central-API-data-fetch-using/m-p/4759958#M10817</link>
      <description>&lt;P&gt;My company’s IT team has built APIs to access Microsoft Dynamics 365 Business Central data. I successfully tested these APIs using Postman. However, when I try to call the API to obtain the bearer access token from a Python script in a Microsoft Fabric notebook, it does not work. Below is the Python script I am using. I do not want to use data flows for this. Please note that this API fetches data only for a specific Azure AD account.&lt;/P&gt;&lt;P&gt;If this script isn’t the best approach, I’m open to trying alternative scripting methods&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;import requests
from urllib.parse import urlencode, urlparse, parse_qs
import webbrowser

tenant_id = "tenant_id"
client_id = "client_id"
client_secret = "client_secret"
redirect_uri = "https://oauth.powerbi.com/views/oauthredirect.html"
scope = "https://api.businesscentral.dynamics.com/.default"

# === OAuth Endpoints ===
auth_url = f"https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/authorize"
token_url = f"https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token"

# === Direct to login page ===
params = {
    "client_id": client_id,
    "response_type": "code",
    "redirect_uri": redirect_uri,
    "response_mode": "query",
    "scope": scope,
}
full_auth_url = f"{auth_url}?{urlencode(params)}"
webbrowser.open(full_auth_url)
print("Please login and paste the full redirect URL below.")

# === Capture the code from the redirect ===
redirect_response = input("Paste the full redirect URL here: ")
code = parse_qs(urlparse(redirect_response).query).get("code", [None])[0]

# === Exchange code for token ===
token_data = {
    "grant_type": "authorization_code",
    "code": code,
    "redirect_uri": redirect_uri,
    "client_id": client_id,
    "client_secret": client_secret,
    "scope": scope
}

token_response = requests.post(token_url, data=token_data).json()

# === Get Access Token ===
if "access_token" in token_response:
    access_token = token_response["access_token"]
    print("\n Access Token:\n", access_token)
else:
    print("\n Failed to acquire token:\n", token_response)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jul 2025 10:21:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Microsoft-Dynamic-365-business-Central-API-data-fetch-using/m-p/4759958#M10817</guid>
      <dc:creator>kasun_rumesh</dc:creator>
      <dc:date>2025-07-11T10:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Microsoft Dynamic 365 business Central API data fetch using Fabric note book</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Microsoft-Dynamic-365-business-Central-API-data-fetch-using/m-p/4760644#M10836</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317253" data-lia-user-login="kasun_rumesh" class="lia-mention lia-mention-user"&gt;kasun_rumesh&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;Thank you for reaching out to Microsoft Fabric Community.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Instead of using the interactive OAuth flow, switch to the Client Credentials Flow for automated API access. This method doesn’t require user interaction and allows you to authenticate using just your Client ID, Client Secret, and Tenant ID. The script will request an access token from Azure AD, which can then be used in API calls to Business Central. This is ideal for non-interactive scenarios like in Fabric notebooks.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Jul 2025 08:47:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Microsoft-Dynamic-365-business-Central-API-data-fetch-using/m-p/4760644#M10836</guid>
      <dc:creator>v-venuppu</dc:creator>
      <dc:date>2025-07-12T08:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Microsoft Dynamic 365 business Central API data fetch using Fabric note book</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Microsoft-Dynamic-365-business-Central-API-data-fetch-using/m-p/4761611#M10866</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317253" data-lia-user-login="kasun_rumesh" class="lia-mention lia-mention-user"&gt;kasun_rumesh&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I wanted to check if you had the opportunity to review the information provided and resolve the issue..?Please let us know if you need any further assistance.We are happy to help.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jul 2025 07:30:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Microsoft-Dynamic-365-business-Central-API-data-fetch-using/m-p/4761611#M10866</guid>
      <dc:creator>v-venuppu</dc:creator>
      <dc:date>2025-07-14T07:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: Microsoft Dynamic 365 business Central API data fetch using Fabric note book</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Microsoft-Dynamic-365-business-Central-API-data-fetch-using/m-p/4763858#M10936</link>
      <description>&lt;P&gt;I'm bit new to this. Can you bit further explain about the&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;Client Credentials Flow&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2025 14:28:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Microsoft-Dynamic-365-business-Central-API-data-fetch-using/m-p/4763858#M10936</guid>
      <dc:creator>kasun_rumesh</dc:creator>
      <dc:date>2025-07-15T14:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: Microsoft Dynamic 365 business Central API data fetch using Fabric note book</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Microsoft-Dynamic-365-business-Central-API-data-fetch-using/m-p/4764841#M10947</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317253" data-lia-user-login="kasun_rumesh" class="lia-mention lia-mention-user"&gt;kasun_rumesh&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;The Client Credentials Flow is ideal for non-interactive scenarios like Fabric notebooks. It allows your script to get an access token using just the Tenant ID, Client ID, and Client Secret, without needing user login. This is done by calling Azure AD's token endpoint with the appropriate parameters. Make sure your Azure AD app has the necessary application-level API permissions (e.g., Financials.ReadWrite.All) and that admin consent has been granted. Once the token is received, you can use it to call the Business Central API.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jul 2025 07:51:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Microsoft-Dynamic-365-business-Central-API-data-fetch-using/m-p/4764841#M10947</guid>
      <dc:creator>v-venuppu</dc:creator>
      <dc:date>2025-07-16T07:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Microsoft Dynamic 365 business Central API data fetch using Fabric note book</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Microsoft-Dynamic-365-business-Central-API-data-fetch-using/m-p/4770029#M11090</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317253" data-lia-user-login="kasun_rumesh" class="lia-mention lia-mention-user"&gt;kasun_rumesh&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;May I ask if you have resolved this issue? Please let us know if you have any further issues, we are happy to help.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jul 2025 06:15:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Microsoft-Dynamic-365-business-Central-API-data-fetch-using/m-p/4770029#M11090</guid>
      <dc:creator>v-venuppu</dc:creator>
      <dc:date>2025-07-21T06:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: Microsoft Dynamic 365 business Central API data fetch using Fabric note book</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Microsoft-Dynamic-365-business-Central-API-data-fetch-using/m-p/4774508#M11190</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317253" data-lia-user-login="kasun_rumesh" class="lia-mention lia-mention-user"&gt;kasun_rumesh&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I hope the information provided is helpful.I wanted to check whether you were able to resolve the issue with the provided solutions.Please let us know if you need any further assistance.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jul 2025 05:47:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Microsoft-Dynamic-365-business-Central-API-data-fetch-using/m-p/4774508#M11190</guid>
      <dc:creator>v-venuppu</dc:creator>
      <dc:date>2025-07-24T05:47:57Z</dc:date>
    </item>
  </channel>
</rss>

