AutoDeskR
  • Preface
  • Acknowledgements
  • Introduction
  • Authentication
  • Data Management API
    • Create a Bucket and Upload a File
  • Design Automation API
    • Convert a DWG File to a PDF File
  • Model Derivative API
    • Translate a File into OBJ Format
    • Prepare a File for the Viewer
    • Extract Data from a File
  • Viewer
  • Common Issues
Powered by GitBook
On this page

Was this helpful?

Authentication

PreviousIntroductionNextData Management API

Last updated 5 years ago

Was this helpful?

AutoDesk uses OAuth-based authentication for access to their services. To get started with this package, first visit the tutorial for instructions on creating an app and getting a Client ID and Secret.

We highly recommend that the Client ID, Secret, and access tokens be stored in a file called .Renviron and accessing these keys with the Sys.getenv() function. This step is a possible solution for preventing authentication information from being in a publicly accessible location (e.g. GitHub repo). For more information on storing keys in the .Renviron file and accessing them with Sys.getenv(), see the appendix in this vignette.

To get an access token, use the getToken() function, which returns an object with the access_token, type, and expires_in variables.:

resp <- getToken(id = Sys.getenv("client_id"), secret = Sys.getenv("client_secret"))
myToken <- resp$content$access_token
myToken
[1] "422vSsW9XMizreWsq0OQX8tgwCpC"
Create an App
API Best Practices