Audit Vanity URLs on RStudio Connect#
Answer the Question:
- Which vanity URLs are currently in use on the server?
All content receives a URL that includes its numerical ID at at the time of deployment. Administrators and publishers (if allowed) can create "vanity paths" for content which make the content available at an additional, customized URL.
Vanity URLs can not be nested inside of one another. So if a vanity URL /finance/ already exists, you would not be able to create a new vanity URL at /finance/budget/. You may create sibling paths: /finance/budget/ and /finance/quarterly/ may both exist concurrently.
Step 1 - Get the report code#
Step 2 - Run & Customize the report#
This R Markdown report uses the
/v1/vanities API endpoint available in RStudio Connect 1.8.6 and later. Visit the RStudio Connect API Reference documentation for more information.
Requirements: Administrator API Key
.Renviron file to store your API key and RStudio Connect server URL.
Your RStudio Connect server URL is the same URL you use to access the RStudio Connect dashboard, minus the connect path. If you access the dashboard at
https://rsc.company.com/connect/, the server URL is
# ~/.Renviron # The CONNECT_SERVER URL must have a trailing slash. CONNECT_SERVER="https://rsc.company.com/" CONNECT_API_KEY="mysupersecretapikey"
Restart your R session to pick up on the new environment variables.
Step 3 - Publish the report to RStudio Connect#
If you are push-button publishing from the RStudio IDE, we recommend the selection "Publish document with source code" so that the report can be re-executed on a schedule.1
Step 4 (optional) - Set the report to update on a schedule#
Automate a data refresh of your report by setting it up to run on a schedule. Open the
Schedule content management pane to get started.
Read more about Scheduling in the RStudio Connect User Guide.
If you are using RStudio v 1.8.8 or higher, RStudio Connect will automatically provide these environment variables for you when you publish. If you are on an older version of Connect, or if this feature has been disabled by your admin, you should reference https://docs.rstudio.com/connect/user/api-keys/ for how to create an API key and https://docs.rstudio.com/connect/user/content-settings/#content-vars for how to input environment variables into the Vars pane of Connect. ↩