Community
BIM 360 API Forum
Welcome to Autodesk’s BIM 360 API Forums. Share your knowledge, ask questions, and explore popular BIM 360 API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

BIM360 API and PowerBI

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
1404 Views, 2 Replies

BIM360 API and PowerBI

Hello all,

 

I am looking for some help connecting BIM360 API to PowerBI web services. I am able to connect and refresh successfully in the PowerBI Desktop app. However, when I publish to the web and try to refresh I am unsuccessful. It has to do with the base url used in the BIM360 API. PowerBI requires the base url to return a 201 success code. The BIM360 API base url does not. Has any one had any experience with this and figure out a way around this?

 

If not how could I submit a request for Autodesk to make some sort of adjustment to their API?

 

Here is an example of my code and the support answer for Microsoft...

 

Example of the code I am using in PowerBI:

let
Source = Json.Document(Web.Contents("https://developer.api.autodesk.com/",
[RelativePath= "project/v1/hubs", Headers=[Authorization="Bearer " &AuthToken&""]])),
data = Source[data],

in 

Source

 

Microsoft answer:

 

 if the root URL of the your api works with anonymous access, you can publish the report that uses the Headers option to pass an API key and the refresh should work in Power BI Service. However, if your root URL returns error with anonymous access, refresh in Power BI Service will fail.

 

Thanks for any help!

Tags (3)
2 REPLIES 2
Message 2 of 3
rosalesduquej
in reply to: Anonymous

Hello,

 

A 201 Status indicates that as a result of HTTP POST request, one or more new resources have been successfully created on server. The BIM 360 API 200 indicates that the request has been processed successfully on server. Based on the code you provided it seems you are doing an API call to retrieve the Hubs available within BIM 360.

 

I don't think the need to modify the API response exists here. If what you need is a 201 status, you can maybe tweak the value that the BIM response gives you and if it is a 200 to pass a 201 to Power BI. We have many customers who have done integrations with Power Bi successfully which did not required a change on the BIM API. I personally I'm not familiar with Power Bi but I do know the BIM 360 side, and getting a 200 it is the correct status code it should be returning. 

 

Cheers,



Jaime Rosales D.
Sr. Developer Consultant
Twitter | AEC ADN DevBlog
Message 3 of 3
Anonymous
in reply to: rosalesduquej

I should of been more specific. I can connect and refresh just fine in the PowerBI desktop. The issue is when trying to fresh with a scheduled refresh in the PowerBI web service. Microsoft PowerBI web service has to validate a connection the the base URL in the code. In this case it is "https://developer.api.autodesk.com/" This page returns a 404 status. It need to return a valid status code (200 or 201).  Please see attached screen shot and error details at the bottom of post.

 

For example if you call something from the Field API. The base URL is "https://bim360field.autodesk.com/" which in PowerbI returns a success and allows you to refresh from the web service. 

 

Here is an article on the issue with M query and API's. 

https://blog.crossjoin.co.uk/2016/08/23/web-contents-m-functions-and-dataset-refresh-errors-in-power...

 

 

Unable to connect: We encountered an error while trying to connect to . Details: "We could not register this data source for any gateway instances within this cluster. Please find more details below about specific errors for each gateway instance."Hide details

Activity ID: bf07675d-4f8d-4929-a21d-d3201546d174
Request ID: 63162f35-cd57-4bd9-3183-0016b190675b
Cluster URI: https://wabi-us-north-central-redirect.analysis.windows.net
Status code: 400
Error Code: DMTS_PublishDatasourceToClusterErrorCode
Time: Fri May 03 2019 13:09:06 GMT-0500 (Central Daylight Time)
Version: 13.0.9264.166
PowerBI: Unable to connect to the data source undefined.
Underlying error code: -2147467259
Underlying error message: Web.Contents failed to get contents from 'https://developer.api.autodesk.com/' (404): Not Found
DM_ErrorDetailNameCode_UnderlyingHResult: -2147467259
Microsoft.Data.Mashup.ValueError.DataSourceKind: Web
Microsoft.Data.Mashup.ValueError.DataSourcePath: https://developer.api.autodesk.com/
Microsoft.Data.Mashup.ValueError.Reason: DataSource.Error
Microsoft.Data.Mashup.ValueError.Url: https://developer.api.autodesk.com/

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report