The Object Storage Service (OSS) is a generic Cloud Storage Service that is part of the Forge Data Management API. In this task, you upload a Revit file (rme_advanced_sample_project.rvt) to OSS. This file is an MEP file that contains space and zone information. This file is available in the tutorial_data folder.
In this tutorial, you will use a Postman environment variable named ossBucketKey
to hold the Object Key of the Bucket that contains your files in the cloud. If you already have a bucket (from a previous tutorial), set the ossBucketKey
variable to the Object Key of that bucket by following step 1, and ignore the rest of the steps in this section.
-
Specify a value for the Bucket Key in the Postman Environment Variable named
ossBucketKey
:-
Click the Environment quick look icon (the eye icon) on the upper right corner of Postman.
-
In the CURRENT VALUE column, in the ossBucketKey row, specify a name for the Bucket that stores your files.
Notes:
-
The Bucket name needs to be unique throughout the OSS service. If a Bucket with the name you specified exists, the system returns a
409
conflict error in step 5. If you receive this error, change the value of this variable and try again. -
The Bucket name must consist of only lower-case characters, numbers 0-9, and the underscore (_) character.
-
-
Click the Environment quick look icon to hide the variables.
-
-
In the Postman sidebar, click Task 2 - Upload Source File to OSS > POST Create a Bucket. The request loads.
-
Click the Body tab, and verify that the
bucketkey
attribute has been set to the variableossBucketKey
. -
Click Send. If the request is successful, you should see a screen similar to the following image.
Before you upload a file to OSS, you must obtain a signed upload URL for the file. To obtain a signed upload URL:
-
In the Postman sidebar, click Task 2 - Upload Source File to OSS > GET Obtain Signed URL. The request loads.
Note the use of
ossBucketkey
andossSourceFileObjectKey
as URI parameters. -
Click the Environment quick look button and set the Postman environment variable
ossSourceFileObjectKey
torme_advanced_sample_project.rvt
, which you will use as the Object Key. -
Click Params tab, and note the
minutesExpiration
parameter is defined as 5 minutes. -
Click Send. A script in the Tests tab updates the following Postman environment variables:
Variable Name Description UploadKey The upload key assigned to the file you want to upload. ContentUploadSignedURL The signed upload URL you must use to upload the zip file
You should see a screen similar to the following image:
Now that you have obtained a signed upload URL, you can go ahead and upload the zip file to OSS.
-
Download the file rme_advanced_sample_project.rvt from the tutorial_data folder of GitHub repository containing this tutorial.
-
In the Postman sidebar, click Task 2 - Upload Source File to OSS > PUT Upload the File. The request loads.
Note the use of
ContentUploadSignedURL
as the URI. -
Click the Body tab.
-
Click Select File and select the file rme_advanced_sample_project.rvt, which you downloaded in step 1.
-
Click Send to upload the file.
Although you uploaded the source file in one go, it is possible to split a file into chunks and upload the file one chunk at a time. Once all the chunks are uploaded you must inform OSS that the upload operation is complete. Even though you uploaded the file in one go, you must finalize the upload by informing OSS that the upload is done. To finalize the upload:
-
In the Postman sidebar, click Task 2 - Upload Source File to OSS > POST Finalize Upload. The request loads.
Note the use of
ossBucketkey
andossSourceFileObjectKey
as URI parameters. -
Click the Body tab, and verify that the
uploadKey
attribute has been set to the variableUploadKey
. -
Click Headers tab. Notice the
Authorization
andContent-Type
Headers are already defined. -
Click Send to finalize the upload. A script in the Tests tab updates the following Postman environment variables:
Variable Name Description t7_ossSourceFileObjectKey Object Key of the source file. Should be rme_advanced_sample_project.rvt
.t7_ossSourceFileURN Value of the objectId
attribute in the JSON response. This is the URN of the source file.t7_ossEncodedSourceFileURN The URN of the source file, converted to a Base64-encoded URN. You should see a screen similar to the following image: