Request

Response

    Reference Guide

    TypeScript SDK Reference for OSS

    Resource Information

    Package Name:
    @aps_sdk/oss
    Version:
    1.0.0

    Installing this Library

    npm i @aps_sdk/oss
    

    Learning Resources

    Source Code

    The source code for this library is available at https://github.com/autodesk-platform-services/aps-sdk-node.

    Tutorials

    The Simple Viewer tutorial on the https://tutorials.autodesk.io/ site illustrates how to use this library to store a model in a bucket. It also illustrates how to access the model for translation to the SVF2 format, so that the model can be displayed in a browser.

    Code Sample

    import { ObjectDetails, OssClient } from "@aps_sdk/oss";
    
    // Access token for authentication
    const ACCESS_TOKEN = "...";
    // Key for the bucket where the object will be stored
    const BUCKET_KEY = "...";
    // Key for the object to be uploaded
    const OBJECT_KEY = "...";
    // Source path or data of the object to be uploaded
    const FILEPATH_OR_BUFFER ="...";
    
    // Initialize the OSS Client
    const ossClient = new OssClient();
    
    // Upload the object to the specified bucket with the given object key and source
    const ObjectDetails = await ossClient.uploadObject(BUCKET_KEY, OBJECT_KEY, FILEPATH_OR_BUFFER, { accessToken: ACCESS_TOKEN});
    
    // Log the details of the uploaded object to the console
    console.log(objectDetails);
    
    Show More

    See https://github.com/autodesk-platform-services/aps-sdk-node/blob/main/samples/oss.ts for a complete code sample.


    SDK to REST API Cross Reference

    Operation CategoryOperationMethodHTTP Request

    Buckets

    Create Bucket createBucket POST /buckets
    List Buckets getBuckets GET /buckets
    Get Bucket Details getBucketDetails GET /buckets/{bucketKey}/details
    Delete Bucket deleteBucket DELETE /buckets/{bucketKey}

    Objects

    Delete Object deleteObject DELETE /buckets/{bucketKey}/objects/{objectKey}
    List Objects getObjects GET /buckets/{bucketKey}/objects
    Get Object Details getObjectDetails GET /buckets/{bucketKey}/objects/{objectKey}/details
    Generate OSS Signed URL createSignedResource POST /buckets/{bucketKey}/objects/{objectKey}/signed
    Download Object Using Signed URL getSignedResource GET /signedresources/hash
    Replace Object Using Signed URL uploadSignedResource PUT /signedresources/{hash}
    Delete Object Using Signed URL deleteSignedResource DELETE /signedresources/{hash}
    Upload Object Using Signed URL uploadSignedResourcesChunk PUT /signedresources/{hash}/resumable
    Copy Object copyTo PUT /buckets/{bucketKey}/objects/{objectKey}/copyto/{newObjName}
    Generate Signed S3 Download URL signedS3Download GET /buckets/{bucketKey}/objects/{objectKey}/signeds3download
    Generate Signed S3 Upload URL signedS3Upload GET /buckets/{bucketKey}/objects/{objectKey}/signeds3upload
    Complete Upload to S3 Signed URL completeSignedS3Upload POST /buckets/{bucketKey}/objects/{objectKey}/signeds3upload
    Batch Generate Signed S3 Download URLs batchSignedS3Download POST/buckets/{bucketKey}/objects/batchsigneds3download
    Batch Generate Signed S3 Upload URLs batchSignedS3Upload POST /buckets/{bucketKey}/objects/batchsigneds3upload
    Complete Batch Upload to S3 Signed URLs batchCompleteUpload POST buckets/{bucketKey}/objects/batchcompleteupload

    SDK-Only Operations

    Operation CategoryOperationMethodDescription

    Objects

    Upload an Object uploadObject Uploads a file or stream by transparently handling operations like obtaining signed URLs, chunking large files for optimal transfer, and notifying OSS to assemble the uploaded parts.
    Download an Object downloadObject Downloads a file by transparently handling operations like obtaining signed download URLs.
     
    ______
    icon-svg-close-thick

    Cookie preferences

    Your privacy is important to us and so is an optimal experience. To help us customize information and build applications, we collect data about your use of this site.

    May we collect and use your data?

    Learn more about the Third Party Services we use and our Privacy Statement.

    Strictly necessary – required for our site to work and to provide services to you

    These cookies allow us to record your preferences or login information, respond to your requests or fulfill items in your shopping cart.

    Improve your experience – allows us to show you what is relevant to you

    These cookies enable us to provide enhanced functionality and personalization. They may be set by us or by third party providers whose services we use to deliver information and experiences tailored to you. If you do not allow these cookies, some or all of these services may not be available for you.

    Customize your advertising – permits us to offer targeted advertising to you

    These cookies collect data about you based on your activities and interests in order to show you relevant ads and to track effectiveness. By collecting this data, the ads you see will be more tailored to your interests. If you do not allow these cookies, you will experience less targeted advertising.

    icon-svg-close-thick

    THIRD PARTY SERVICES

    Learn more about the Third-Party Services we use in each category, and how we use the data we collect from you online.

    icon-svg-hide-thick

    icon-svg-show-thick

    Strictly necessary – required for our site to work and to provide services to you

    Qualtrics
    W
    Akamai mPulse
    W
    Digital River
    W
    Dynatrace
    W
    Khoros
    W
    Launch Darkly
    W
    New Relic
    W
    Salesforce Live Agent
    W
    Wistia
    W
    Tealium
    W
    Upsellit
    W
    CJ Affiliates
    W
    Commission Factory
    W
    Google Analytics (Strictly Necessary)
    W
    Typepad Stats
    W
    Geo Targetly
    W
    SpeedCurve
    W
    Qualified
    #

    icon-svg-hide-thick

    icon-svg-show-thick

    Improve your experience – allows us to show you what is relevant to you

    Google Optimize
    W
    ClickTale
    W
    OneSignal
    W
    Optimizely
    W
    Amplitude
    W
    Snowplow
    W
    UserVoice
    W
    Clearbit
    #
    YouTube
    #

    icon-svg-hide-thick

    icon-svg-show-thick

    Customize your advertising – permits us to offer targeted advertising to you

    Adobe Analytics
    W
    Google Analytics (Web Analytics)
    W
    AdWords
    W
    Marketo
    W
    Doubleclick
    W
    HubSpot
    W
    Twitter
    W
    Facebook
    W
    LinkedIn
    W
    Yahoo! Japan
    W
    Naver
    W
    Quantcast
    W
    Call Tracking
    W
    Wunderkind
    W
    ADC Media
    W
    AgrantSEM
    W
    Bidtellect
    W
    Bing
    W
    G2Crowd
    W
    NMPI Display
    W
    VK
    W
    Adobe Target
    W
    Google Analytics (Advertising)
    W
    Trendkite
    W
    Hotjar
    W
    6 Sense
    W
    Terminus
    W
    StackAdapt
    W
    The Trade Desk
    W
    RollWorks
    W

    Are you sure you want a less customized experience?

    We can access your data only if you select "yes" for the categories on the previous screen. This lets us tailor our marketing so that it's more relevant for you. You can change your settings at any time by visiting our privacy statement

    Your experience. Your choice.

    We care about your privacy. The data we collect helps us understand how you use our products, what information you might be interested in, and what we can improve to make your engagement with Autodesk more rewarding.

    May we collect and use your data to tailor your experience?

    Explore the benefits of a customized experience by managing your privacy settings for this site or visit our Privacy Statement to learn more about your options.