Shorten URL

Shorten a long URL

get
Shorten URL

https://us-central1-zero-width-shortener.cloudfunctions.net/shortenURL
This endpoint returns the short ID corresponding to the specified long URL.
Request
Response
Query Parameters
url
required
string
The long URL to shorten. Must not contain the URL shortener's hostname or exceed 500 characters in length.
200: OK
The URL has already been shortened and was fetched from the database.
{
"short": "Short ID"
}
201: Created
The URL was shortened and added to the database.
{
"short": "Short ID"
}
400: Bad Request
The URL wasn't specified, wasn't string type, was invalid, or contained the URL shortener's hostname.
URL was not specified
URL is invalid
URL contains hostname
invalid URL type
{
"error": "You must specify a URL"
}
413: Request Entity Too Large
The URL exceeded 500 characters.
{
"error": "URL can not exceed 500 characters"
}

‚Äč