getToken {AutoDeskR} | R Documentation

## Get a 2-Legged Token for Authentication.

### Description

Get a 2-legged token for OAuth-based authentication to the AutoDesk Forge Platform.

### Usage

    getToken(id = NULL, secret = NULL, scope = "data:write data:read")

### Arguments

`id` | A string. Client ID for the app generated from the AutoDesk Dev Portal.
`secret` | A string. Client Secret for the app generated from the AutoDesk Dev Portal.
`scope` | A string. Space-separated list of required scopes. May be `user-profile:read`, `data:read`, `data:write`, `data:create`, `data:search`, `bucket:create`, `bucket:read`, `bucket:update`, `bucket:delete`, `code:all`, `account:read`, `account:write`, or a combination of these.

### Value

An object containing the `access_token`, `code_type`, and `expires_in` milliseconds.

### See Also

https://developer.autodesk.com/en/docs/oauth/v2/overview/

### Examples

    ## Not run:
    # Get a 2-legged token with the "data:read" and "data:write" scopes
    resp <- getToken(id = Sys.getenv("client_id"), secret = Sys.getenv("client_secret"),
               scope = "data:write data:read")
    myToken <- resp$content$access_token

    ## End(Not run)

[Package AutoDeskR version 0.1.3 Index]