If you're have a URl like this - someLongUrl.subLinkOnHost.mail.com/index.html
This API can make it to this - localhost:8080/7KX
If you're have server with domain - short.com It will be looks like - short.com/7KX
someLongUrl.subLinkOnHost.mail.com/index.html ---> short.com/7KX
⚪ POST /api/create-short
Request body: application/json
Example value:
{
"longUrl": "yourLongURL.com"
}
Description: Successfully converted!
Media type: application/json
Example value:
{
"shortUrl": "7LK"
}
Description: Bad Request!
Media type: application/json
Example value:
{
"statusCode": 400,
"message": "We'll need a valid URL, like 'yourbrnd.co/niceurl'",
"timestamp": 1679584728598
}
⚪ GET /api/get-long/{shortUrl}
Request body: application/json
Example value: shortUrl in PathVariable : /api/get-long/7LK
Description: Url successfully found!
Media type: application/json
Example value:
{
"longUrl": "yourLongURL.com"
}
Description: Url not Found!
Media type: application/json
Example value:
{
"statusCode": 404,
"message": "This shortUrl doesn't exist or his duration was expired",
"timestamp": 1679587416465
}
⚪ GET /{shortUrl}
Request body: application/json
Example value: shortUrl in PathVariable : /7LK
Description: Url successfully found and redirected!
As a result of sending this request, you will be redirected to http://yourLongUrl.com
Media type: application/html
Example value:
redirect:http://yourLongUrl.com
<html>
...
...
...
<html>
Description: Url not Found!
Media type: application/json
Example value:
{
"statusCode": 404,
"message": "This shortUrl doesn't exist or his duration was expired",
"timestamp": 1679587416465
}
⚪ longUrl
type: string
maxLength: 2147483647
minLength: 3
⚪ shortUrl
type: string
maxLength: 2147483647
minLength: 1
⚪ expiresDate
type: string($date-time)