Skip to main content

TinyURL

Learn how to minify the long website links in your text messages using TinyURL.

Before you begin

  1. Sign up with TinyURL
  2. Once you have logged in, click on Account in the top right corner.
  3. In the left navigation pane, select API.
  4. Create an API Token by giving it a name and permission to Create TinyURL.
  5. Make note of the API Token as it will be required in Extension's settings.

Extension settings

  1. Login to CometChat and select your app.
  2. Go to the Extensions section and enable the TinyURL extension.
  3. Open the settings and enter the TinyURL API Token.
  4. If you have chosen a paid plan, you can also save your BYO domain or subdomain. Default is set to tinyurl.com
  5. Save your settings.
BYO Domain

If you don't plan on using a custom domain, please save tinyurl.com as the default value here.

How does it work?

This extension uses the callExtension method provided by CometChat SDK. You can call the extension as follows:

CometChat.callExtension("url-shortener-tinyurl", "POST", "v1/shorten", {
text: "Your message with URL https://yourdomain.com/very/very/long/url",
})
.then((response) => {
// minifiedText in response
})
.catch((error) => {
// Error occured
});