- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

how to run REST endpoint in M
I am currently trying to achieve the below with M query - is this doable? any suggestions are welcome.. Thanks in advance
This is what I need to be able to do
1. First I need to run to call a REST endpoint to start the export
2. running the above REST endpoint, the output will look something like the below
https://tis.obss.io/rest/export/3kjhrqoi-asd-3rrd34-3rerwr34-94c797e9f590
I need to run the post command output to get to the data table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi again
A bit of progress with the Mquerying. this is how my Mquery looks like
When executing the first time, I get the expected results.
However when refreshing the query, I get a 404 error:
Web.Contents failed to get contents pointing to the sourcelink given in 'webdata.2' - any suggestions how to deal with this?
Many thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Assuming that your REST service answers with JSON, you would do something like
let
Source = Json.Document(Web.Contents("https://api.powerbi.com/v1.0/myorg/gateways/" & GatewayId & "/datasources", [Headers=[Authorization=Authorization]])),
It becomes tricky when your request fails or when it succeeds with a malformed response (looking at YOU, MICROSOFT!)
let
JsonData = try Json.Document(Web.Contents("https://api.powerbi.com/v1.0/myorg/gateways/" & GatewayId & "/datasources/" & ConnectionId & "/status", [Headers=[Authorization=Authorization]])),
value = if JsonData[Error][Message]="We reached the end of the buffer." then "True" else "False"
in
value
In this example "We reached the end of the buffer" is caused by a blank 200 return, and is actually the desired outcome.

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
12-19-2024 07:09 PM | |||
08-26-2024 08:33 AM | |||
01-01-2025 01:31 AM | |||
12-23-2024 02:17 PM | |||
11-22-2024 12:03 AM |