Skip to content

xiaodongliang/forge-bim360-docs.api-postman.collection

Repository files navigation

Postman Collection for BIM360 Document Management (Docs) API

Postman

Beginner License

Description

This repository provides demos for the category of BIM360 Document Management (Docs) API . Right now, the APIs demos are:

  • Custom Attributes
  • Folder Permissions
  • Download PDF

The collection will be kept updated with new APIs. As to Get Documents/Items/Versions/Objects, they belong to Data Management APIs. This collection does not include them.

What's Postman?

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.

Setup

  1. 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

  2. BIM 360 Account and project: must be Account Admin to add the app integration. Learn about provisioning. Make a note with the account name

  3. Ensure Project Management module has been activated in BIM 360 project. Make a note with the project name .

  4. 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.relationship.api-postman.collection

  5. Import the collection and environment files to Postman

  6. In environment, input client id, client secret, hub name with account name, and project name as project name

Generate Token

This collection takes Inheriting auth to apply token to every endpoint in the collection automatically, which means it does not need to input the token in the header explicitly.

Some Forge API endpoints support 3-legged token only, some may support both 2-legged token and 3-legged token.

2-legged token scenario

In context menu of collection >> Edit, switch to the tab Authorization. switch type to Bearer Token. Input the token name as access_token

In such scenario, before running other scripts, firstly run the script __GET 2Legged Token -Optional - when you need to test with 2LO__

3-legged token scenario

In context menu of collection >> Edit, switch to the tab Authorization. switch type to OAuth 2.0:

input the variables in Configure New Token. Get New Access Token, and Update

  • 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
  • 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

API Test

  1. Assume the steps of Setup have been performed. The access token is ready.

  2. Play the scripts. Try to change some parameters or body with more scenarios.

  3. With Postman Runner, these scripts can be chained to perform auto-test. Check Tests tab to define your preferred tests.

License

This sample is licensed under the terms of the MIT License. Please see the LICENSE file for full details.

Written by

Xiaodong Liang @coldwood, Forge Partner Development

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published