Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cmtarayao
New Member

Power BI Rest API Error

Hi All,

 

I have problem in posting data to REST API using the python3, part of the script below

 

REST_API_URL = "https://api.powerbi.com/beta/93fc8b07-5b2f-4a23-ae62-844e9ba4e216/datasets/83bc213e-1fa1-4264-ae43-39a88fdbdd93/rows?key=o4owv8NDQVFxVE6MUjf0oCXOrGomEHIgbClSRm3ao%2FfTnnDefPLpJMbK6owk%2FkPmMPymnEA8SrG0KfPSNMp5gg%3D%3D"
data ='[{{ "extraction_datetime": "2017-11-11 00:00:00", "location": "Bayombong", "rainfall": "0" }}]'
data=data.encode('utf-8')

req=urllib.reqeust.Request(REST_API_URL,data)
response=urllib.request.urlopen(req)

At first it works fine and my dashboard working really well. After few days (started last November 10) I got a problem HTTP Error 404: Not Found (when executing the main script). 

 

Please help.

Thanks in advance.

3 REPLIES 3
Eric_Zhang
Employee
Employee


@cmtarayao wrote:

Hi All,

 

I have problem in posting data to REST API using the python3, part of the script below

 

REST_API_URL = "https://api.powerbi.com/beta/93fc8b07-5b2f-4a23-ae62-844e9ba4e216/datasets/83bc213e-1fa1-4264-ae43-39a88fdbdd93/rows?key=o4owv8NDQVFxVE6MUjf0oCXOrGomEHIgbClSRm3ao%2FfTnnDefPLpJMbK6owk%2FkPmMPymnEA8SrG0KfPSNMp5gg%3D%3D"
data ='[{{ "extraction_datetime": "2017-11-11 00:00:00", "location": "Bayombong", "rainfall": "0" }}]'
data=data.encode('utf-8')

req=urllib.reqeust.Request(REST_API_URL,data)
response=urllib.request.urlopen(req)

At first it works fine and my dashboard working really well. After few days (started last November 10) I got a problem HTTP Error 404: Not Found (when executing the main script). 

 

Please help.

Thanks in advance.


@cmtarayao

The endpoints indicates that you're calling a POST API to send data to a streaming dataset. In this case, the non-existence of the target dataset usually causes the 404 error. Please go to Power BI Service to check if the streaming dataset exists or not. 

Hi Eric, 

 

Thanks for the quick reply. Checking the Power BI Service, I found out that the error occur when the historic data analysis is turned ON. I tried two cases, sample not saving history while sample2 does save.

Capture.JPG

With historic data analysis  OFF, calling POST API is successful. On the otherhand, if turned ON, that's the time the problem occur. Does any other solution when I want historic data to be saved while having streaming dataset/dashboard?

 

Thanks.

 

 


@cmtarayao wrote:

Hi Eric, 

 

Thanks for the quick reply. Checking the Power BI Service, I found out that the error occur when the historic data analysis is turned ON. I tried two cases, sample not saving history while sample2 does save.

Capture.JPG

With historic data analysis  OFF, calling POST API is successful. On the otherhand, if turned ON, that's the time the problem occur. Does any other solution when I want historic data to be saved while having streaming dataset/dashboard?

 

Thanks.

 

 


@cmtarayao

That is weird. I don't reproduce this issue. Could you try to re-copy the endpoints from those two datasets and test? What's going on if you copy the powershell scription and execute in teh PowerShell ISE?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Kudoed Authors