How to Use API

Api Url Endpoint: https://titly.site/wp-json/cls/v1/shorten


Method: POST


Parameters:
api_key – Your API key
url – The URL to shorten
custom_code – (Optional) Custom short code for the URL


Example Request:
curl -X POST https://titly.site/wp-json/cls/v1/shorten\
-H “Content-Type: application/x-www-form-urlencoded” \
-d “api_key=YOUR_API_KEY&url=https://example.com&custom_code=mylink”

Another Example:
fetch(“https://titly.site/wp-json/cls/v1/shorten”, {
method: “POST”,
headers: { “Content-Type”: “application/x-www-form-urlencoded” },
body: url=${encodeURIComponent(longUrl)}&api_key=ADD YOUR API HERE&custom_code=${encodeURIComponent(customCode)}
})

Click Here to Request WordPress Plugin