This sample app demonstrates how to use the OAuth, Data Management and Model Derivative Forge APIs, as well as the Forge Viewer JavaScript library. It shows the following typical workflow:
- Create a 2-legged authentication token
- Create a bucket (an arbitrary space to store objects)
- Upload a file to the bucket
- Prepare the file for displaying in the Viewer (translate the file into SVF format)
- Show the translated file in the Viewer
Ruby version 2.0 and above.
$ sudo gem install rest-client
Create an app on the Forge Developer portal, and ensure that you select the Data Management and Model Derivative APIs. Note the client ID and client secret.
Open the config.rb file, and replace CLIENT_ID
and CLIENT_SECRET
with the client ID and client secret generated when creating the app.
$ ruby app.rb