Integrate with "Shorten.REST API Documentation" from shorten.rest in no time with Mockoon's ready to use mock sample
Speed up your application development by using "Shorten.REST API Documentation" ready-to-use mock sample. Mocking this API will allow you to start working in no time. No more accounts to create, API keys to provision, accesses to configure, unplanned downtime, just work.
It also improves your integration tests' quality and reliability by accounting for random failures, slow response time, etc.
The Shorten.rest API allows you to programmatically create short URLs (an 'alias') for longer URL (a 'destination').
Each alias you create can be used to redirect the end user (person clicking on the link) to one or more destination URLs
A default destination is always set and specific destinations can be set to redirect the end user to preferred destinations based on the user's geographical location (country) and device Operating System.
In order to use the Shorten.Rest URL Shortening API you can choose to bind your own branded domain, sub-domain or to use our default domain - Short.FYI
When creating or editing a short URL ('alias') you can choose to specify a destination for each country and OS (Supported OSes list) combination.
When a user clicks on the short link, Shorten.rest will examine the end user's country (determined by User's IP) and OS (User agent) and match the most suitable destination for each user.
(*) If no destination is set for a specific request combination Shorten.rest will use the default destination that exists within each short URL
(**) BRANDED DOMAINS: If the requested alias does not exist in our database - Shorten.rest will redirect the user to the default fallback you set within your dashboard under the ‘Alias Not Found Page Url’ value for a custom domain.
(*) Operating System (OS) destinations are stronger than a country destination!
For example - if you have a custom landing page that is targeting people in the USA and a second landing page that is hyper focused for people who use iOS devices - a person clicking on your link in the USA that is on an iPhone will be redirected to the iOS landing page, while all other devices will be redirected to the USA landing page.
| OS | Country | Destination |
| :------------: |:---------------:| -----|
| iOS | | YourDestination.com/ios |
| | US | YourDestination.com/usa |
Shorten.rest will choose the YourDestination.com/ios url as the most suitable destination.
Branded Domain Attributes
When setting up your custom domain you can include optional metatags and snippets (Supported snippets list). These parameters (such as retargeting, tracking and conversion pixels) are populated and fired on click - at the time of the redirect.
By default the parameters you set in the domain setting will be included in all Short URLs associated with that domain.
You can always override the domain defaults for each URL by passing the appropriate variables when creating or updating a short URL
Setting a Custom string for an Alias (short.fyi/alias)
While creating a short URL you can specify which domain to use. You can choose to use your own branded domain or our default domain - Short.fyi.
Each Alias is unique within a domain they are related to. This means that if multiple accounts use you the same domain (for example short.fyi), if an alias is already taken you may not create a new destination for it.
That said - If you would like to use a specific alias which is already taken - the only way to do so is to create it on a new domain you own and have attached to your Shorten.rest account.
By default - unless you specify a vanity URI for your alias each URL that is shortened on our platform will have a random string generated by the API. This means that if the 'alias' attribute of a /aliases POST request is not provided, or is an empty string, a random string of seven characters will be generated and returned as part of the POST response.
You can also place the @rnd macro within the alias field when you create a new alias, for example /vanity/@rnd, which might return an alias like /vanity/ZMAefRt, or /[email protected], which might produce something like /vanityMRtvxadf. Only the first @rnd in an alias attribute will be replaced.
( * ) All methods of the Shorten.REST API require that your API key be provided in x-api-key header.
(**) All API parameters are case sensitive