R script that uses 2-legged OAuth and BIM 360 API to extract companies' data from BIM 360 Account Administration
This is a sample code that shows how to use R programming to extract companies' infromation from a BIM 360 Account. The output of this script is a data frame that contains the company directory data from BIM 360 Account. A good way to use this script is by importing it as a data source in Power BI Desktop to analyze BIM 360 data.
- Visit the Forge Developer Portal and sign up for an account
- Create an App. Callback URL is not being used by this script. When asked for the 'callback URL', you can use any URL
- Take note of the Client ID and Client Secret.
- Log into your BIM 360 Account Admin site, https://admin.b360.autodesk.com/
- Go to “SETTINGS” tab then to “Custom Integrations” tab
- Click on “Add Custom Integration” button to register your app for this specific account.
- Take note of the BIM 360 Account ID.
- Install R: Here is a guide on how to install R, http://rprogramming.net/how-to-install-r-fast/.
- Load 'httr' and 'jsonlite' packages: Here is a guide on how load packeges to R, https://www.statmethods.net/interface/packages.html.
- Install RStudio (optional): Here is a guide on how to download and install RStudio, http://rprogramming.net/download-and-install-rstudio/.
Before executing the R script from the Export BIM360 Company Data.R file, input Client ID, Client Secret, and BIM 360 Account ID from steps 1 & 2 into lines 6, 7, and 8 of the script.
- Install PowerBI Desktop: Download from https://powerbi.microsoft.com/desktop/
- Click on Get Data and select R Script
- Copy the R script from the Export BIM360 Company Data.R file and Paste in the Script box
- Input Client ID, Client Secret, and BIM 360 Account ID from steps 1 & 2 into lines 6, 7, and 8 of the script.
- Click Ok and select BIM360_Company_Data table to load it to PowerBI
To test how this R script works in Power BI, downlaod the following PowerBI Template for BIM 360 Company Data.pbit
To run this template, you need Client ID, Client Secret, and BIM 360 Account ID from steps 1 & 2 in Setup and you need to setup R as per step 3 in Setup.
The successful loading of the template should show results similar to this.
This sample is licensed under the terms of the MIT License. Please see the LICENSE file for full details.
Sam Nseir, P.E. @samnseirpe, Autodesk Enterprise Priority Support