Shorten

Shorten.REST API Documentation

Introduction The Shorten.rest API allows you to programmatically create short URLs (an 'alias') for longer URL (a 'destination'). Each alias you create can be…

Developer tools#openapi#developer-tools

Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.

Overview

Introduction

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

Destination Matching

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.

OSCountryDestination
iOSYourDestination.com/ios
USYourDestination.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.

Random Aliases

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 /vanity@rnd, which might produce something like /vanityMRtvxadf. Only the first @rnd in an alias attribute will be replaced.

NOTES

( * ) 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

Endpoints 7

Alias

  • GETGet alias/aliases?domainName=your.domain.com&aliasName=aBcDe012Get detailed information for a single alias by providing its alias and domain name
  • PUTUpdate alias/aliases?domainName=your.domain.com&aliasName=aBcDe012Update a single short URL by providing its alias and domain as a parameter, and the data you wish to update in the body of the request. If no domain is…
  • POSTCreate alias/aliases?domainName=your.domain.com&aliasName=aBcDe012This POST method creates a new alias under a specified domain. If no domain is specified in the request the alias will be attached to the default domain…
  • DELETEDelete alias/aliases?domainName=your.domain.com&aliasName=aBcDe012Deletes a single alias by providing alias and domain. If no domain is provided the API will search for the matching alias within the Short.fyi domain
  • GETGet aliases by domain/aliases/all?domainName=your.domain.com&continueFrom=1588788835614657618&limit=100Obtain a list of all alias names associated with your account and given domain. Result array is in descending order by creation date. If no domain is…

Click

  • GETGet clicks/clicks?continueFrom=1588788835614657618&limit=100Retrieve the raw click data for your account. Clicks are retrieved by creation date in descending order. If there are more results than the limit for the…

Statistics

  • POSTGet clicks statistics/clicks/pgRetrieve the raw click statistics for your account. Clicks are retrieved by creation date in descending order.

API details

Base URL
https://api.shorten.rest
Authentication
An API key in the x-api-key header
Operations
7 operations on 4 pathsGET 3POST 2PUT 1DELETE 1
Main resources
Alias 5Click 1Statistics 1
Response formats
application/json
Description format
OpenAPI 3.0.0, API version 1.0.0
Listed from
APIs.guru OpenAPI Directory (CC0-1.0)
Source updated

How to test the Shorten.REST API Documentation in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the Shorten.REST API Documentation collection, without the publisher's secrets.
  3. Add your credentialsThis API uses an API key in the x-api-key header. Add yours in the collection's variables or an environment; the requests already reference it.
  4. Send a requestPick an endpoint, for example “Get alias” (GET /aliases?domainName=your.domain.com&aliasName=aBcDe012), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the Shorten.REST API Documentation?

Introduction The Shorten.rest API allows you to programmatically create short URLs (an 'alias') for longer URL (a 'destination'). Each alias you create can be… It is listed under Developer tools and has 7 endpoints.

Who publishes the Shorten.REST API Documentation?

It is listed from Shorten's public API description (an OpenAPI document), not published by Shorten on Swastik Codes. Anyone who controls shorten.rest can claim the profile by adding a DNS TXT record.

What is the base URL of the Shorten.REST API Documentation?

Requests go to https://api.shorten.rest. Endpoint paths are added to this base URL.

How do I authenticate with the Shorten.REST API Documentation?

With an API key in the x-api-key header.

How many endpoints does the Shorten.REST API Documentation have?

7 operations on 4 paths (3 GET, 2 POST, 1 PUT, 1 DELETE). The largest groups are Alias, Click, Statistics.

Is forking the Shorten.REST API Documentation free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.