| Title: | An Interface to the 'AutoDesk' 'API' Platform |
|---|---|
| Description: | An interface to the 'AutoDesk' Platform Services ('APS') 'API' including the Authentication 'API' for obtaining 'OAuth2' tokens with expiry tracking, Data Management 'API' for managing buckets and objects across the platform's cloud services, Design Automation 'API' for running automated tasks on design files in the cloud, Model Derivative 'API' for translating design files into 'SVF', 'SVF2', 'OBJ', and 'STL' formats and extracting model data, Reality Capture 'API' for generating 3D models from photogrammetry image sets, and Viewer for rendering 2D and 3D models in 'Shiny' applications. |
| Authors: | Paul Govan [aut, cre, cph] (ORCID: <https://orcid.org/0000-0002-1821-8492>) |
| Maintainer: | Paul Govan <[email protected]> |
| License: | Apache License | file LICENSE |
| Version: | 0.5.0 |
| Built: | 2026-05-28 20:30:49 UTC |
| Source: | https://github.com/paulgovan/autodeskr |
Create a structured error condition for failures returned by the AutoDesk
Platform Services (APS) API. Callers can use
tryCatch(..., aps_error = function(e) ...) to handle these errors.
aps_error(message, status, body, call = sys.call(-1))aps_error(message, status, body, call = sys.call(-1))
message |
A string. Human-readable error message. |
status |
An integer. HTTP status code. |
body |
A list. Parsed JSON body of the error response. |
call |
The call where the error occurred (internal use). |
A condition object of class c("aps_error", "error", "condition").
## Not run: tryCatch( makeBucket(token = "bad_token"), aps_error = function(e) cat("HTTP", e$status, "-", e$message) ) ## End(Not run)## Not run: tryCatch( makeBucket(token = "bad_token"), aps_error = function(e) cat("HTTP", e$status, "-", e$message) ) ## End(Not run)
Requires the tibble package.
## S3 method for class 'listBuckets' as_tibble(x, ...)## S3 method for class 'listBuckets' as_tibble(x, ...)
x |
A |
... |
Additional arguments (unused). |
A tibble with one row per bucket and columns
bucketKey, bucketOwner, and policyKey.
## Not run: library(tibble) listBuckets(token = myToken) |> as_tibble() ## End(Not run)## Not run: library(tibble) listBuckets(token = myToken) |> as_tibble() ## End(Not run)
Requires the tibble package.
## S3 method for class 'listObjects' as_tibble(x, ...)## S3 method for class 'listObjects' as_tibble(x, ...)
x |
A |
... |
Additional arguments (unused). |
A tibble with one row per object and columns
objectKey, objectId, size, and location.
## Not run: library(tibble) listObjects(token = myToken, bucket = "mybucket") |> as_tibble() ## End(Not run)## Not run: library(tibble) listObjects(token = myToken, bucket = "mybucket") |> as_tibble() ## End(Not run)
Returns a named list of ellmer::tool() objects that expose
AutoDeskR functions to AI models via the Model Context Protocol (MCP).
Credentials are read from the APS_CLIENT_ID and
APS_CLIENT_SECRET environment variables; no token argument is
required in any tool call.
autodeskr_mcp_tools()autodeskr_mcp_tools()
A named list of ellmer::tool objects covering Authentication,
Data Management, Model Derivative, Design Automation, and Reality Capture.
## Not run: Sys.setenv(APS_CLIENT_ID = "your_id", APS_CLIENT_SECRET = "your_secret") tools <- autodeskr_mcp_tools() mcptools::mcp_server(tools = tools) ## End(Not run)## Not run: Sys.setenv(APS_CLIENT_ID = "your_id", APS_CLIENT_SECRET = "your_secret") tools <- autodeskr_mcp_tools() mcptools::mcp_server(tools = tools) ## End(Not run)
Check the status of a recently created app-managed bucket using the Data Management API.
checkBucket(token = NULL, bucket = "mybucket")checkBucket(token = NULL, bucket = "mybucket")
token |
A string or |
bucket |
A string. Name of the bucket. Defaults to |
An object containing the bucketKey, bucketOwner, and
createdDate.
## Not run: # Check the status of a bucket with the name "mybucket" resp <- checkBucket(token = myToken, bucket = "mybucket") resp ## End(Not run)## Not run: # Check the status of a bucket with the name "mybucket" resp <- checkBucket(token = myToken, bucket = "mybucket") resp ## End(Not run)
Check the status of a recently translated file using the Model Derivative API.
checkFile(urn = NULL, token = NULL)checkFile(urn = NULL, token = NULL)
urn |
A string. Source URN (objectId) for the file. Note the URN must be
Base64 encoded. To encode the URN, see, for example, the
|
token |
A string or |
## Not run: # Check the status of the translated "aerial.dwg" svf file resp <- checkFile(urn = myEncodedUrn, token = myToken) resp ## End(Not run)## Not run: # Check the status of the translated "aerial.dwg" svf file resp <- checkFile(urn = myEncodedUrn, token = myToken) resp ## End(Not run)
Check the status of a Design Automation WorkItem using the Design Automation API v3.
checkPdf(id = NULL, token = NULL, source = NULL, destination = NULL)checkPdf(id = NULL, token = NULL, source = NULL, destination = NULL)
id |
A string. WorkItem ID returned by |
token |
A string or |
source |
Deprecated. Ignored with a warning. |
destination |
Deprecated. Ignored with a warning. |
An object containing the WorkItem id, status, and
stats.
## Not run: mySource <- "http://download.autodesk.com/us/samplefiles/acad/visualization_-_aerial.dwg" myDestination <- "https://example.com/output/aerial.pdf" resp <- makePdf(mySource, myDestination, token = myToken) myWorkItemId <- resp$content$id # Poll for completion resp <- checkPdf(id = myWorkItemId, token = myToken) resp ## End(Not run)## Not run: mySource <- "http://download.autodesk.com/us/samplefiles/acad/visualization_-_aerial.dwg" myDestination <- "https://example.com/output/aerial.pdf" resp <- makePdf(mySource, myDestination, token = myToken) myWorkItemId <- resp$content$id # Poll for completion resp <- checkPdf(id = myWorkItemId, token = myToken) resp ## End(Not run)
Poll the processing status of a photoscene. Use
waitForPhotoscene to block until processing completes.
checkPhotoscene(photoscene_id = NULL, token = NULL)checkPhotoscene(photoscene_id = NULL, token = NULL)
photoscene_id |
A string. Photoscene ID returned by
|
token |
A string or |
An object of class checkPhotoscene containing
resp$content$photoscene$progress (percentage string) and
resp$content$photoscene$progressmsg.
## Not run: status <- checkPhotoscene(photoscene_id = myPhotosceneId, token = myToken) status$content$photoscene$progress ## End(Not run)## Not run: status <- checkPhotoscene(photoscene_id = myPhotosceneId, token = myToken) status$content$photoscene$progress ## End(Not run)
Create a new photoscene for photogrammetry processing using the Reality
Capture API. Upload images with uploadImages, then start
processing with processPhotoscene.
createPhotoscene(name = NULL, format = "rcm", token = NULL)createPhotoscene(name = NULL, format = "rcm", token = NULL)
name |
A string. Name for the photoscene. |
format |
A string. Output format. One of |
token |
A string or |
An object of class createPhotoscene containing the
photosceneid at resp$content$photoscene$photosceneid.
## Not run: ps <- createPhotoscene(name = "my-scene", format = "obj", token = myToken) myPhotosceneId <- ps$content$photoscene$photosceneid ## End(Not run)## Not run: ps <- createPhotoscene(name = "my-scene", format = "obj", token = myToken) myPhotosceneId <- ps$content$photoscene$photosceneid ## End(Not run)
Delete an app-managed bucket using the Data Management API.
deleteBucket(token = NULL, bucket = "mybucket")deleteBucket(token = NULL, bucket = "mybucket")
token |
A string or |
bucket |
A string. Name of the bucket to delete. Defaults to
|
An object containing the HTTP status code of the response.
## Not run: # Delete a bucket named "mybucket" resp <- deleteBucket(token = myToken, bucket = "mybucket") ## End(Not run)## Not run: # Delete a bucket named "mybucket" resp <- deleteBucket(token = myToken, bucket = "mybucket") ## End(Not run)
Delete an object from an app-managed bucket using the Data Management API.
deleteObject(token = NULL, bucket = "mybucket", object = NULL)deleteObject(token = NULL, bucket = "mybucket", object = NULL)
token |
A string or |
bucket |
A string. Name of the bucket. Defaults to |
object |
A string. Key (name) of the object to delete. |
An object containing the HTTP status code of the response.
## Not run: # Delete the "aerial.dwg" object from "mybucket" resp <- deleteObject(token = myToken, bucket = "mybucket", object = "aerial.dwg") ## End(Not run)## Not run: # Delete the "aerial.dwg" object from "mybucket" resp <- deleteObject(token = myToken, bucket = "mybucket", object = "aerial.dwg") ## End(Not run)
Download a file from the AutoDesk Platform Services using the Model Derivative API.
downloadFile(urn = NULL, output_urn = NULL, token = NULL, destfile = NULL)downloadFile(urn = NULL, output_urn = NULL, token = NULL, destfile = NULL)
urn |
A string. Source URN (objectId) for the file. Note the URN must be
Base64 encoded. To encode the URN, see, for example, the
|
output_urn |
A string. Output URN retrieved via |
token |
A string or |
destfile |
A string. Local file path to save binary responses (e.g.
downloaded geometry files). When |
An object containing either parsed JSON content or, for binary responses, the path to the saved file.
## Not run: # Download the "aerial.dwg" obj file myEncodedOutputUrn <- jsonlite::base64_enc(myOutputUrn) resp <- downloadFile(urn <- myEncodedUrn, output_urn <- myEncodedOutputUrn, token = myToken, destfile = "aerial.obj") ## End(Not run)## Not run: # Download the "aerial.dwg" obj file myEncodedOutputUrn <- jsonlite::base64_enc(myOutputUrn) resp <- downloadFile(urn <- myEncodedUrn, output_urn <- myEncodedOutputUrn, token = myToken, destfile = "aerial.obj") ## End(Not run)
Get the geometry of an uploaded file using the Model Derivative API.
getData(guid = NULL, urn = NULL, token = NULL)getData(guid = NULL, urn = NULL, token = NULL)
guid |
A string. GUID retrieved via the |
urn |
A string. Source URN (objectId) for the file. Note the URN must be
Base64 encoded. To encode the URN, see, for example, the
|
token |
A string or |
An object containing the geometry data for the selected file.
## Not run: # Get the geometry data for the "aerial.dwg" svf file resp <- getData(guid = myGuid, urn = myEncodedUrn, token = myToken) ## End(Not run)## Not run: # Get the geometry data for the "aerial.dwg" svf file resp <- getData(guid = myGuid, urn = myEncodedUrn, token = myToken) ## End(Not run)
Get the metadata of an uploaded file using the Model Derivative API.
getMetadata(urn = NULL, token = NULL)getMetadata(urn = NULL, token = NULL)
urn |
A string. Source URN (objectId) for the file. Note the URN must be
Base64 encoded. To encode the URN, see, for example, the
|
token |
A string or |
An object containing the type, name, and guid of
the file.
## Not run: # Get the metadata for the "aerial.dwg" svf file resp <- getMetadata(urn <- myEncodedUrn, token = myToken) myGuid <- resp$content$data$metadata[[1]]$guid ## End(Not run)## Not run: # Get the metadata for the "aerial.dwg" svf file resp <- getMetadata(urn <- myEncodedUrn, token = myToken) myGuid <- resp$content$data$metadata[[1]]$guid ## End(Not run)
Get the object tree of an uploaded file using the Model Derivative API.
getObjectTree(guid = NULL, urn = NULL, token = NULL)getObjectTree(guid = NULL, urn = NULL, token = NULL)
guid |
A string. GUID retrieved via the |
urn |
A string. Source URN (objectId) for the file. Note the URN must be
Base64 encoded. To encode the URN, see, for example, the
|
token |
A string or |
An object containing the object tree for the selected file.
## Not run: # Get the object tree for the "aerial.dwg" svf file resp <- getObjectTree(guid = myGuid, urn = myEncodedUrn, token = myToken) resp ## End(Not run)## Not run: # Get the object tree for the "aerial.dwg" svf file resp <- getObjectTree(guid = myGuid, urn = myEncodedUrn, token = myToken) resp ## End(Not run)
Get the output urn of a translated file using the Model Derivative API.
getOutputUrn(urn, token)getOutputUrn(urn, token)
urn |
A string. Source URN (objectId) for the file. Note the URN must be
Base64 encoded. To encode the URN, see, for example, the
|
token |
A string or |
An object containing the result, urn, and additional
activity information.
## Not run: # Get the output urn for the "aerial.dwg" obj file resp <- getOutputUrn(urn = myUrn, token = Sys.getenv("token")) resp ## End(Not run)## Not run: # Get the output urn for the "aerial.dwg" obj file resp <- getOutputUrn(urn = myUrn, token = Sys.getenv("token")) resp ## End(Not run)
Get a 2-legged token for OAuth-based authentication to the AutoDesk Platform Services (APS).
getToken(id = NULL, secret = NULL, scope = "data:write data:read")getToken(id = NULL, secret = NULL, scope = "data:write data:read")
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
|
An aps_token object containing the access_token,
token_type, expires_in, and expires_at. The token can
be passed directly to other AutoDeskR functions. Use
is_expired to check whether the token needs refreshing.
Legacy access via resp$content$access_token continues to work.
## Not run: tok <- getToken(id = Sys.getenv("client_id"), secret = Sys.getenv("client_secret"), scope = "data:write data:read") myToken <- tok$access_token is_expired(tok) ## End(Not run)## Not run: tok <- getToken(id = Sys.getenv("client_id"), secret = Sys.getenv("client_secret"), scope = "data:write data:read") myToken <- tok$access_token is_expired(tok) ## End(Not run)
Check Whether an aps_token Has Expired.
is_expired(token)is_expired(token)
token |
An |
Logical. TRUE if the token has expired, FALSE otherwise.
## Not run: tok <- getToken(id = Sys.getenv("client_id"), secret = Sys.getenv("client_secret")) is_expired(tok) ## End(Not run)## Not run: tok <- getToken(id = Sys.getenv("client_id"), secret = Sys.getenv("client_secret")) is_expired(tok) ## End(Not run)
List all app-managed buckets using the Data Management API.
listBuckets(token = NULL, limit = 10, startAt = NULL, region = "US")listBuckets(token = NULL, limit = 10, startAt = NULL, region = "US")
token |
A string or |
limit |
An integer. Maximum number of buckets to return. Defaults to
|
startAt |
A string. Bucket key to start the list from (for pagination).
Defaults to |
region |
A string. Region filter. May be |
An object containing a list of bucket details.
## Not run: # List all buckets resp <- listBuckets(token = myToken) resp$content$items ## End(Not run)## Not run: # List all buckets resp <- listBuckets(token = myToken) resp$content$items ## End(Not run)
List objects stored in an app-managed bucket using the Data Management API.
listObjects(token = NULL, bucket = "mybucket", limit = 10)listObjects(token = NULL, bucket = "mybucket", limit = 10)
token |
A string or |
bucket |
A string. Name of the bucket. Defaults to |
limit |
An integer. Maximum number of objects to return. Defaults to
|
An object containing a list of objects in the bucket.
## Not run: # List objects in "mybucket" resp <- listObjects(token = myToken, bucket = "mybucket") resp$content$items ## End(Not run)## Not run: # List objects in "mybucket" resp <- listObjects(token = myToken, bucket = "mybucket") resp$content$items ## End(Not run)
Make an app-based bucket for storage of design files using the Data Management API.
makeBucket(token = NULL, bucket = "mybucket", policy = "transient")makeBucket(token = NULL, bucket = "mybucket", policy = "transient")
token |
A string or |
bucket |
A string. Unique bucket name. Defaults to |
policy |
A string. May be |
An object containing the bucketKey, bucketOwner, and
createdDate.
## Not run: # Make a transient bucket with the name "mybucket" resp <- makeBucket(token = myToken, bucket = "mybucket", policy = "transient") ## End(Not run)## Not run: # Make a transient bucket with the name "mybucket" resp <- makeBucket(token = myToken, bucket = "mybucket", policy = "transient") ## End(Not run)
Convert a publicly accessible DWG file to a publicly accessible PDF using the Design Automation API v3.
makePdf(source = NULL, destination = NULL, token = NULL)makePdf(source = NULL, destination = NULL, token = NULL)
source |
A string. Publicly accessible web address of the input DWG file. |
destination |
A string. Publicly accessible web address for the output PDF file. |
token |
A string or |
An object containing the WorkItem id, status, and
stats. Use id with checkPdf to poll for
completion, or use waitForWorkItem to block until done.
## Not run: mySource <- "http://download.autodesk.com/us/samplefiles/acad/visualization_-_aerial.dwg" myDestination <- "https://example.com/output/aerial.pdf" resp <- makePdf(mySource, myDestination, token = myToken) myWorkItemId <- resp$content$id ## End(Not run)## Not run: mySource <- "http://download.autodesk.com/us/samplefiles/acad/visualization_-_aerial.dwg" myDestination <- "https://example.com/output/aerial.pdf" resp <- makePdf(mySource, myDestination, token = myToken) myWorkItemId <- resp$content$id ## End(Not run)
Initiate photogrammetry processing for a photoscene that has had images
uploaded via uploadImages.
processPhotoscene(photoscene_id = NULL, token = NULL)processPhotoscene(photoscene_id = NULL, token = NULL)
photoscene_id |
A string. Photoscene ID returned by
|
token |
A string or |
An object of class processPhotoscene containing the
processing response.
## Not run: proc <- processPhotoscene(photoscene_id = myPhotosceneId, token = myToken) ## End(Not run)## Not run: proc <- processPhotoscene(photoscene_id = myPhotosceneId, token = myToken) ## End(Not run)
Translate an uploaded file into OBJ format using the Model Derivative API.
translateObj(urn = NULL, token = NULL)translateObj(urn = NULL, token = NULL)
urn |
A string. Source URN (objectId) for the file. Note the URN must be
Base64 encoded. To encode the URN, see, for example, the
|
token |
A string or |
An object containing the result, urn, and additional
activity information.
## Not run: # Translate the "aerial.dwg" file into an obj file resp <- translateObj(urn = myEncodedUrn, token = myToken) ## End(Not run)## Not run: # Translate the "aerial.dwg" file into an obj file resp <- translateObj(urn = myEncodedUrn, token = myToken) ## End(Not run)
Translate an uploaded file into STL format using the Model Derivative API.
translateStl(urn = NULL, token = NULL)translateStl(urn = NULL, token = NULL)
urn |
A string. Source URN (objectId) for the file. Note the URN must be
Base64 encoded. To encode the URN, see, for example, the
|
token |
A string or |
An object containing the result, urn, and additional
activity information.
## Not run: # Translate the "aerial.dwg" file into an stl file resp <- translateStl(urn = myEncodedUrn, token = myToken) ## End(Not run)## Not run: # Translate the "aerial.dwg" file into an stl file resp <- translateStl(urn = myEncodedUrn, token = myToken) ## End(Not run)
Translate an uploaded file into SVF format using the Model Derivative API.
translateSvf(urn = NULL, token = NULL)translateSvf(urn = NULL, token = NULL)
urn |
A string. Source URN (objectId) for the file. Note the URN must be
Base64 encoded. To encode the URN, see, for example, the
|
token |
A string or |
An object containing the result, urn, and additional
activity information.
## Not run: # Translate the "aerial.dwg" file into a svf file myEncodedUrn <- jsonlite::base64_enc(myUrn) resp <- translateSvf(urn = myEncodedUrn, token = myToken) ## End(Not run)## Not run: # Translate the "aerial.dwg" file into a svf file myEncodedUrn <- jsonlite::base64_enc(myUrn) resp <- translateSvf(urn = myEncodedUrn, token = myToken) ## End(Not run)
Translate an uploaded file into SVF2 format using the Model Derivative API.
SVF2 is the next-generation viewer format: approximately 30
SVF and faster to load in the Autodesk Viewer. Use it in place of
translateSvf for new projects.
translateSvf2(urn = NULL, token = NULL, views = c("2d", "3d"))translateSvf2(urn = NULL, token = NULL, views = c("2d", "3d"))
urn |
A string. Source URN (objectId) for the file. Note the URN must be
Base64 encoded. To encode the URN, see, for example, the
|
token |
A string or |
views |
A character vector. Views to generate. Defaults to
|
An object containing the result, urn, and additional
activity information.
## Not run: # Translate the "aerial.dwg" file into SVF2 format myEncodedUrn <- jsonlite::base64_enc(myUrn) resp <- translateSvf2(urn = myEncodedUrn, token = myToken) ## End(Not run)## Not run: # Translate the "aerial.dwg" file into SVF2 format myEncodedUrn <- jsonlite::base64_enc(myUrn) resp <- translateSvf2(urn = myEncodedUrn, token = myToken) ## End(Not run)
Upload a design file to an app-managed bucket using the Data Management API.
uploadFile(file = NULL, token = NULL, bucket = "mybucket")uploadFile(file = NULL, token = NULL, bucket = "mybucket")
file |
A string. File path. |
token |
A string or |
bucket |
A string. Unique bucket name. Defaults to |
An object containing the bucketKey, objectId (i.e.
urn), objectKey (i.e. file name), size, contentType
(i.e. "application/octet-stream"), location. and other content
information.
## Not run: # Upload the "aerial.dwg" file to "mybucket" resp <- uploadFile(file = system.file("inst/samples/aerial.dwg", package = "AutoDeskR"), token = myToken, bucket = "mybucket") myUrn <- resp$content$objectId ## End(Not run)## Not run: # Upload the "aerial.dwg" file to "mybucket" resp <- uploadFile(file = system.file("inst/samples/aerial.dwg", package = "AutoDeskR"), token = myToken, bucket = "mybucket") myUrn <- resp$content$objectId ## End(Not run)
Upload a design file of any size to an app-managed bucket using the signed
S3 URL approach recommended by AutoDesk Platform Services (APS). Unlike
uploadFile, this function supports files larger than 100 MB.
uploadFileSigned(file = NULL, token = NULL, bucket = "mybucket")uploadFileSigned(file = NULL, token = NULL, bucket = "mybucket")
file |
A string. File path. |
token |
A string or |
bucket |
A string. Unique bucket name. Defaults to |
An object containing the finalized upload response with
bucketKey, objectId, objectKey, size, and
location.
## Not run: # Upload a large file using signed S3 URLs resp <- uploadFileSigned( file = "path/to/large_model.rvt", token = myToken, bucket = "mybucket" ) myUrn <- resp$content$objectId ## End(Not run)## Not run: # Upload a large file using signed S3 URLs resp <- uploadFileSigned( file = "path/to/large_model.rvt", token = myToken, bucket = "mybucket" ) myUrn <- resp$content$objectId ## End(Not run)
Upload one or more image files to an existing photoscene for Reality Capture processing.
uploadImages(photoscene_id = NULL, files = NULL, token = NULL)uploadImages(photoscene_id = NULL, files = NULL, token = NULL)
photoscene_id |
A string. Photoscene ID returned by
|
files |
A character vector. Local file paths to image files (JPEG or PNG). |
token |
A string or |
An object of class uploadImages containing the upload
response.
## Not run: imgs <- uploadImages( photoscene_id = myPhotosceneId, files = c("img1.jpg", "img2.jpg", "img3.jpg"), token = myToken ) ## End(Not run)## Not run: imgs <- uploadImages( photoscene_id = myPhotosceneId, files = c("img1.jpg", "img2.jpg", "img3.jpg"), token = myToken ) ## End(Not run)
Launch the Viewer.
viewer3D(urn = NULL, token = NULL, viewerType = "header")viewer3D(urn = NULL, token = NULL, viewerType = "header")
urn |
A string. Source URN (objectId) for the file. Note the URN must be
Base64 encoded. To encode the URN, see, for example, the
|
token |
A string. Token generated with |
viewerType |
A string. The type of viewer to instantiate. Either "header" for the default viewer, "headless" for a viewer without toolbar or panels, or "vr" to enter WebVR mode on a mobile device. |
## Not run: # View the "aerial.dwg" file in the AutoDesk viewer myEncodedUrn <- jsonlite::base64_enc(myUrn) viewer3D(urn <- myEncodedUrn, token = myToken) ## End(Not run)## Not run: # View the "aerial.dwg" file in the AutoDesk viewer myEncodedUrn <- jsonlite::base64_enc(myUrn) viewer3D(urn <- myEncodedUrn, token = myToken) ## End(Not run)
UI Module Function.
viewerUI(id, urn = NULL, token = NULL, viewerType = "header")viewerUI(id, urn = NULL, token = NULL, viewerType = "header")
id |
A string. A namespace for the module. |
urn |
A string. Source URN (objectId) for the file. Note the URN must be
Base64 encoded. To encode the URN, see, for example, the
|
token |
A string. Token generated with |
viewerType |
A string. The type of viewer to instantiate. Either "header" for the default viewer or "headless" for a viewer without toolbar or panels. |
## Not run: ui <- function(request) { shiny::fluidPage( viewerUI("pg", myEncodedUrn, myToken) ) } server <- function(input, output, session) { } shiny::shinyApp(ui, server) ## End(Not run)## Not run: ui <- function(request) { shiny::fluidPage( viewerUI("pg", myEncodedUrn, myToken) ) } server <- function(input, output, session) { } shiny::shinyApp(ui, server) ## End(Not run)
Polls checkFile at a fixed interval until the translation
reaches a terminal state ("success", "failed", or
"timeout").
waitForFile(urn, token, interval = 5, timeout = 300, verbose = TRUE)waitForFile(urn, token, interval = 5, timeout = 300, verbose = TRUE)
urn |
A string. Base64-encoded source URN. |
token |
A string or |
interval |
Seconds between polls. Defaults to |
timeout |
Maximum seconds to wait before aborting. Defaults to
|
verbose |
If |
The final checkFile response object.
## Not run: myEncodedUrn <- jsonlite::base64_enc(myUrn) resp <- translateSvf(urn = myEncodedUrn, token = myToken) done <- waitForFile(urn = myEncodedUrn, token = myToken) done$content$status ## End(Not run)## Not run: myEncodedUrn <- jsonlite::base64_enc(myUrn) resp <- translateSvf(urn = myEncodedUrn, token = myToken) done <- waitForFile(urn = myEncodedUrn, token = myToken) done$content$status ## End(Not run)
Polls checkPhotoscene at a fixed interval until processing
reaches 100% or an error occurs.
waitForPhotoscene( photoscene_id, token, interval = 30, timeout = 1800, verbose = TRUE )waitForPhotoscene( photoscene_id, token, interval = 30, timeout = 1800, verbose = TRUE )
photoscene_id |
A string. Photoscene ID returned by
|
token |
A string or |
interval |
Seconds between polls. Defaults to |
timeout |
Maximum seconds to wait before aborting. Defaults to
|
verbose |
If |
The final checkPhotoscene response object.
## Not run: ps <- createPhotoscene("my-scene", token = myToken) id <- ps$content$photoscene$photosceneid imgs <- uploadImages(id, c("img1.jpg", "img2.jpg"), myToken) proc <- processPhotoscene(id, myToken) done <- waitForPhotoscene(id, myToken) done$content$photoscene$progress ## End(Not run)## Not run: ps <- createPhotoscene("my-scene", token = myToken) id <- ps$content$photoscene$photosceneid imgs <- uploadImages(id, c("img1.jpg", "img2.jpg"), myToken) proc <- processPhotoscene(id, myToken) done <- waitForPhotoscene(id, myToken) done$content$photoscene$progress ## End(Not run)
Polls checkPdf at a fixed interval until the WorkItem reaches
a terminal state (any status other than "inprogress" or
"pending").
waitForWorkItem(id, token, interval = 5, timeout = 300, verbose = TRUE)waitForWorkItem(id, token, interval = 5, timeout = 300, verbose = TRUE)
id |
A string. WorkItem ID from |
token |
A string or |
interval |
Seconds between polls. Defaults to |
timeout |
Maximum seconds to wait before aborting. Defaults to
|
verbose |
If |
The final checkPdf response object.
## Not run: resp <- makePdf(source = mySource, destination = myDest, token = myToken) done <- waitForWorkItem(id = resp$content$id, token = myToken) done$content$status ## End(Not run)## Not run: resp <- makePdf(source = mySource, destination = myDest, token = myToken) done <- waitForWorkItem(id = resp$content$id, token = myToken) done$content$status ## End(Not run)