This repository provides demos for API Reference, and demos for Tutorials of RFI API.The scripts of tutorials are not exactly same to the document, while the API logic behind is similar.
Postman is a popular tool that provides an easy-to-use interface to send HTTP requests. Postman is able to parse the responses that Forge sends you and save response parameter values to variables. These parameters can then be reused in subsequent requests through these variables. The Postman collections in this repository use this ability to provide pre-populated HTTP requests to help you follow the tutorial workflow with minimal effort. You can also modify the requests and experiment without having to write a single line of code.
-
You can learn how to install and use Postman from here.
-
You can download the Postman installer from here.
-
Forge Account: Learn how to create a Forge Account, activate the subscription and create an app by this tutorial. Get Forge client id, client secret and callback url. Please register Forge app with the callback url as
https://www.getpostman.com/oauth2/callback
-
BIM 360 Account and project: must be Account Admin to add the app integration. Learn about provisioning. Make a not with the account name
-
Ensure Project Management module has been activated in BIM 360 project. Make a note with the project name .
-
Ensure Document Management module has been activated and one model file has been uploaded to Project Files folder.
-
Clone this repository or download it. It's recommended to install GitHub Desktop. To clone it via command line, use the following (Terminal on MacOSX/Linux, Git Shell on Windows):
git clone https://github.com/xiaodongliang/forge-bim360.rfi.api-postman.collection
-
Import the collection and environment files to Postman
-
In environment, input client id, client secret, my bim account name with account name, and my test project name as project name
-
In context menu of collection >> Edit, switch to the tab Authorization. Click Get New Access Token, input the variables as below:
-
Grant Type
Authorization Code
-
Callback URL
https://www.getpostman.com/oauth2/callback
-
Auth URL
https://developer.api.autodesk.com/authentication/v1/authorize
-
Access Token URL
https://developer.api.autodesk.com/authentication/v1/gettoken
-
Client ID
{{client_id}}
-
Client Secret
{{client_secret}}
-
Scope
data:read data:write account:read bucket:read
-
Client Authentication
Send Client credentials body
-
-
Click Request Token, it will direct to login Autodesk account, after it succeeds, the token will be generated. Click Use Token. Then, click Update to close the window of Edit
RFI API requires to work with 3-legged token. This collection takes Inheriting auth to apply 3-legged token to every endpoint in the collection automatically, which means it does not need to input the token in the header explicitly.
-
Assume the steps of Setup have been performed. The access token is ready.
-
Run the scripts in the folder of Run Firstly one by one. It will get RFI container ID and prepare user id and one file lineage urn (for attachment test) and seed urn (for pushpin demo).
-
Play the API scripts. Try to change some parameters or body with more scenarios.
- Assume the steps of Setup have been performed. The access token is ready.
- Run the scripts in the tutorial folder one by one. They can be also tested by Postman Runner
- RFI API requires to work with 3-legged token. This collection takes Inheriting auth to apply 3-legged token to every endpoint in the collection, which means it does not need to input the token in the header explicitly.
This sample is licensed under the terms of the MIT License. Please see the LICENSE file for full details.
Xiaodong Liang @coldwood, Forge Partner Development