REST APIs for managing short URLs
- create - Shorten a URL.
Shorten a URL.
require 'speakeasy_client_sdk_ruby'
s = ::OpenApiSDK::SpeakeasyClientSDK.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
api_key: "<YOUR_API_KEY_HERE>",
)
)
req = ::OpenApiSDK::Operations::CreateRequestBody.new(
url: "https://probable-heating.com/",
)
res = s.short_ur_ls.create(req)
if ! res.short_url.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
request |
::OpenApiSDK::Operations::CreateRequestBody | ✔️ | The request object to use for the request. |