Important: These instructions are specific to Postman V10. If you are using a newer version of Postman, you may notice slight differences in the interface or steps, but the basic procedure should remain similar.
The Object Storage Service (OSS) is a generic Cloud Storage Service that is part of the Data Management API. In this task, you upload the source file to OSS. While you can use any model, for this walkthrough we recommend that you use the Revit model we provide (rac_basic_sample_project.rvt).
In this walkthrough, 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 walkthrough), 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 (
) 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 already exists, the server 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 only consist of lower-case characters, the 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
parameter 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
torac_basic_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 rac_basic_sample_project.rvt from the walkthrough_data folder of this walkthrough.
-
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 rac_basic_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 Send to finalize the upload. You should see a screen similar to the following image.
A script in the Tests tab updates the following Postman environment variables:
Variable Name Description t5_ossSourceFileObjectKey Object Key of the source file. Should be rac_basic_sample_project.rvt
.t5_ossSourceFileURN Value of the objectId
attribute in the JSON response. This is the URN of the source file.t5_ossEncodedSourceFileURN The URN of the source file, converted to a Base64-encoded URN.