The Building Coder

Token Expiry and Online Revit API Docs

My vacation ended and I am now in Porto, putting the last touches to my presentation material for the RTC Revit Technology Conference Europe and the ISEPBIM Forge and BIM workshops at ISEP, the Instituto Superior de Engenharia do Porto.

Porto Porto

Here are today's Revit API and Forge news items:

Updated Online Revit API Docs

Gui Talarico updated the online Revit API documentation

www.RevitAPIdocs.com

In his own words:

In case you haven't seen it yet, I just wanted to share with you the latest version of RevitAPIdocs.com:

Here is an animation showing a quick overview of the new features:

Revit API Docs new features Revit API Docs new features

The revamped search result landing page looks like this:

Revit API Docs search landing page Revit API Docs search landing page

Many thanks to Gui for providing this really important tool!

Handling Forge Token Expiry

Question: I am working on an app for the Forge and AppStore hackathon challenge.

I am using the models.autodesk.io online tool for token generation.

However, my access token is getting expired.

Please help resolve the issue.

Answer by Cyrille Fauvel: models.autodesk.io is a web site which demonstrates how to easily translate a model using your own consumer and secret key.

It is not intended to be used as an access token generator, because it is highly discouraged to transmit your keys over Internet, even through an encrypted and secured https connection.

Instead, you should write your own code to generate the access token yourself, just like models.autodesk.io does. The relevant part is located in lmv-token.js around line 43.

As you have noticed, the token expires after a while.

This sample does not take care of refreshing it, as this site is to be used manually for a single translation.

In your own implementation, you will need to check the expires_in field to know when the token will expire and make sure to refresh it before it does so as shown in lmv-token.js around line 29.

Thank you, Cyrille, for the complete and succinct answer.