REST API with MS Power BI
Tuesday, May 23, 2023 at 04:46pmI'm trying to call OneSpan API call from MS Power BI, but currently unsuccessful. How does one handle renewing Bearer Token? Below example was attempting to get a Token, didn't output error but seemed to hang. Mike(C)
Reply to: REST API with MS Power BI
Tuesday, May 23, 2023 at 05:00pmTried pasting file info but had to attach . . . Mike(C)
Reply to: REST API with MS Power BI
Wednesday, May 24, 2023 at 12:28pmHi Mike,
I can successfully pull the data from Power BI desktop > get data from web > invoke a GET call with Basic authentication, see the attached screenshots.
If you are trying to invoke a POST call, as suggested in below two posts:
https://community.fabric.microsoft.com/t5/Desktop/Pull-data-from-API-using-POST-method-in-Power-BI/m-p/574727
https://community.fabric.microsoft.com/t5/Desktop/Connect-to-a-Web-Service-sending-parameters/td-p/225510
You can try to set the request body as "Content" in request header:
= let
body = "The POST method body here",
Data= Web.Contents("https://yourusrlhere",[Content=Text.ToBinary(body),Headers=[#"Content-
Type"="application/json"]]),
DataRecord = Json.Document(Data),
Source=DataRecord
in
Source
Let me know how this works for you.
Duo
Reply to: REST API with MS Power BI
Friday, September 8, 2023 at 08:53amHi Duo, I'm trying to replicate the above examples using FedRAMP Production and cannot get past the first two steps. The third step, expanding the results, is grayed out. Since you got it to work, can you please share your query?
Reply to: REST API with MS Power BI
Monday, September 11, 2023 at 12:21pmHi David,
I did a quick test by setting the web source URL as https://signer-gov.esignlive.com/api/packages?from=1&to=100 (note that there's a "signer-" upfront the browser URL) and the base64 decoded API Key as the username and password, see attachment. And this returns the data source.
Duo
Reply to: REST API with MS Power BI
Monday, September 11, 2023 at 02:19pmI was able to get the Source step to work. It produces 2 fields: results and count. results=List and count=381. This is as expected. I then convert to table, but after that, the Expand button (on the Transform tab) is greyed out. I found a workaround, Convert the first value to Table, which produces a list with 100 items. I then convert the list to table, which creates a table with 100 rows. At this point the Expand button becomes available. This gives me the columns. However, I have 381 packages. I tried changing the original query argument to "from=1&to=110" and I still only get 100 rows. I need all 381 packages.
Reply to: REST API with MS Power BI
Monday, September 11, 2023 at 02:37pmUpdate: I was using Power Query in Excel. When I tried it in Power Query for Power BI, it worked much better but it is still only giving me 100 rows.
Reply to: REST API with MS Power BI
Monday, September 11, 2023 at 02:37pmI see. Yes, this is an OSS API limitation that the maximum returned item is 100. So 381 packages require 4 API calls:
/api/packages?from=1&to=100
/api/packages?from=101&to=200
/api/packages?from=201&to=300
/api/packages?from=301&to=400
And this technical blog seems to provide an example where it looped through different data sources:
https://pbi-guy.com/2022/07/05/how-to-loop-through-an-api-with-power-bi-without-knowing-last-page/
Duo
Reply to: REST API with MS Power BI
Monday, September 11, 2023 at 02:55pmOK, thanks. So, another issue:
With this query: = Json.Document(Web.Contents("https://signer-gov.esignlive.com/api/packages?predefined=sent&from=1&to=100"))
I'm not getting just the sent ones.
Reply to: REST API with MS Power BI
Monday, September 11, 2023 at 02:58pmHi David,
Try with the parameter "?query=SENT" instead of predefined.
Duo
Reply to: REST API with MS Power BI
Monday, September 11, 2023 at 03:24pmThank you! That worked!