Skip to contents

short_url sends a POST request to the Short.io API to create a new shortened URL for the provided uri. The function uses environment variable SHORTIO for the API key and sets specific options for the API call, such as not allowing duplicate links and setting a fixed domain for the shortened URL.

Usage

short_url(uri)

Arguments

uri

A character string. The original URL to be shortened.

Value

A character string. The shortened URL returned by the Short.io API.

Details

This function takes a given URL and leverages the Short.io API to generate a shortened version of the URL using the specified custom domain.

Examples

if (FALSE) { # \dontrun{
  # Example usage to shorten a URL
  Sys.setenv(SHORTIO = "your_api_key_here") # Set API key in environment
  short_url("https://www.example.com/very-long-url")
} # }