Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Has anyone used xero api to pull the data in power bi using m-query? I don't want to use any third party connector.
Hi @DiKi-I
Maybe you can try something like:
To use the Xero API to pull data into Power BI using M Query without a third-party connector, follow these steps. This involves making HTTP requests directly to the Xero API in M Query. The process typically includes:
Registering an App in Xero: Register an app in the Xero portal to obtain the required credentials (Client ID and Client Secret).
OAuth 2.0 Authentication: Implement the OAuth 2.0 flow to get an Access Token for API access.
M Query Scripting: Write M Query in Power BI to send requests to the API using functions like Web.Contents.
Here is an example of basic M Query code to make an API request:
m
Copy code
let
BaseUrl = "https://api.xero.com/api.xro/2.0/Invoices",
Headers = [Authorization = "Bearer YOUR_ACCESS_TOKEN"],
Source = Web.Contents(BaseUrl, [Headers = Headers])
in
Source
For more detailed guidance, you may refer to general documentation on OAuth 2.0 authentication
https://developer.xero.com/documentation/oauth2/auth-flow
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Thank you, I'm trying to register the app, could you help me with redirect URI and how I can generate access token -OAuth 2.0 Authentication: Implement the OAuth 2.0 flow to get an Access Token for API access.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
90 | |
84 | |
70 | |
49 |
User | Count |
---|---|
143 | |
121 | |
112 | |
59 | |
58 |