This repository has been deprecated and migrated to https://github.com/autodesk-platform-services/aps-acc-sheet.api-postman.collection
This repository provides a postman collection for Sheets API. Sheets is a feature under Autodesk Build. Please check Field Guide for more details. The API supports both 2-legged and 3-legged token .
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
-
ACC Account and project: must be Account Admin to add the app integration. Learn about provisioning.
-
Follow product help to create one version set and upload some PDFs to Sheets.
-
Get ACC project id (hub id without b.) by API , or copy from browser address of ACC UI.
-
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/autodesk-forge/forge-acc-sheet.api-postman.collection
-
Import the collection and environment files to Postman
-
In environment, input client id, client secret, project id without b
-
This collection takes Inheriting auth to apply access token to every endpoint in the collection automatically, which means it does not need to input the token in the header explicitly.
Although Sheets API supports both 2-legged and 3-legged token, we suggest your application adopts 3-legged token because it will follow the user permission setting of the logged user. If you need to test with 2-legged token in Postman collection, call this endpoint Authentication-2legged-backup to get access_token. From the response, copy this token to the panel of Edit
-
To work with 3-legged token, ensure the logged user has enough permission in UI setting.
Next, 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
-
Client Authentication
Send Client credentials body
Click Get New Access 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.
-
-
Assume the steps of Setup have been performed. The access token is ready.
-
Play the scripts. Try to change some parameters or body with more scenarios. Please check Sheets API Reference for more details
This tutorial demos the whole workflow that uploads sheets till publishing. Please prepare some PDF files (either single page or multiple pages)
- Step 1: create a new version set with custom name and issue date. The post-test script will make a note with the id of version set (versionSetId)
- Step 2: create storage object in the bucket of Sheet of this project. The post-test script will extract bucket key and object key from the storage urn.
- Step 3: this is to call Data Management API to generate Signed S3 URL of this storage above. The post-test script will make a note with signed url
- Step 4: use the signed url in Step 3 to upload the binary file (PDF)
- Step 5: call Data Management API to complete the upload. If you want to upload more PDFs, repeat Step 2 and Step 4
- Step 6: create a new upload of Sheet with all the storage urns of the PDF. At backend of Forge, it will extract each pdf, split them to pages. Each page will be created as one Sheet.
- Step 7: check status of the upload. If it shows IN_REVIEW, it means the sheets are extracted successfully, and ready for review.
- Step 8: get ids of the review sheets.
- Step 9: get thumbnails of the review sheets as a reference when the user reviews the sheet
- Step 10: update the sheets if needed. Basically, ensure their number and title are not conflict. Otherwise, the publishing will throw exception.
- Step 11: publish the upload. It will turn the review sheets to the formal one in Sheet collection
- Step 12: you can double check by calling GET:Sheets endpoint, with the filtering of the specific version set.
- currently, API does not support extract and split Revit model
- currently, API does not support to import PDFs from Files module of ACC project. you must upload PDFs from your local (server/other cloud storage).
Document
Tutorials:
Blogs:
- Forge Blog
- Field of View, a BIM focused blog
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
- 10/08/2022: first release