This is an old revision of the document!
URL shortener service
This is a web service that allows the user to shorten a URL into a small string, similar to Tiny URL, bit.ly, etc. A shortened URL can be edited to change the source URL. Here are some use cases for a user who uses the web service.
Shortening a HTTP/HTTPS URL
The web app submits a HTTP
URL to the web service.
If the service detects that the
URL belongs to a well-known website that also has iOS / Android apps, then the server builds URLs with app-specific schemes that will be used for iOS and Android.
If the
URL does not belong to any well-known website with known apps, then the server will use the same HTTP
URL for iOS and Android also.
The server returns the following to the web app
If the
URL belongs to a well-known app, then which well-known app it is, e.g. facebook, amazon.
The HTTP
URL that was submitted by the web app.
The
URL that will be used by iOS. If not a well-known app, this
URL is the same as the HTTP
URL.
The
URL that will be used by Android.
-
Creating a shortened URL based on user's entry
The web app submits the following details to the web service. Note that the web app can send all three or just one, if only a specific device is being targetted.
-
-
A seperate
URL for Android.
In response, the server creates a short
URL and returns the following response.
The HTTP
URL exactly as submitted by the web app. If this field was blank, then the it is left blank.
The iOS
URL as submitted by the web app.
The Android
URL as submitted by the web app.
-
Updating a shortened URL
The web app submits the following details to change within a
URL. The web app may submit all three or just one or two of the following.
-
-
-
One of the following happens at the server.
If the web app submitted only the HTTP
URL, then the server detects if it is from a well-known website.
If a well-known website with an app, an app-specific iOS and Android
URL are generated.
If not a well-known website, then the HTTP
URL is used for iOS and Android.
Along with the HTTP
URL, if the web app also submits iOS or Android
URL manually, then the server does not detect an app-specific
URL for that
OS. It will stick with what the web app has submitted.
After saving the changes to the shortened
URL, the server returns the following to the web app.
-
the latest iOS
URL: either same as what web app submitted or otherwise auto-detected
the latest Android
URL: either same as what web app submitted or otherwise auto-detected
the short
URL, which remains unchanged despite the updation
User sign up