Skip to main content

Generate Short URL

Generate Short URL

Postman Collection

URL

POST: /v1/shortener/create

HEADERS

ParamsValue
AuthorizationBasic Auth
Content-Typeapplication/json
Acceptapplication/json

Parameters

ParamData TypeRequired
urlStringRequired
labelStringOptional
closedAtTimestampOptional

Request

Body Sample
{
"label": "F1 Mate Shortener",
"url": "https://f1mate.com/short-url",
"closedAt": "2022-10-25 14:10:00"
}
cURL Sample
curl --location --request POST '/v1/shortener/create' \
--header 'Authorization: Basic ZxbV9mZGI5MDVhZWY1NTc5ODgxMjg0NzEwZTZkMzM5ODMyYmU2YTJkNjg5' \
--header 'Content-Type: application/json' \
--data-raw '{
"label": "F1 Mate Shortener",
"url": "https://f1mate.com/short-url",
"closedAt": "2022-10-25 14:10:00"
}'

Response

success
{
"code": "200",
"status": "success",
"message": "Link created Successfully.",
"data": {
"requestId": "REQ419562769645000",
"url": "https://f1m.in/5raRsBQ"
}
}
failed
{
"code": "404",
"status": "failed",
"error": "Requested URL already created."
}
Missing Params
{
"code": "100",
"status": "missing",
"message": "Parameters error.",
"params": {
"url": [
"The url field is required."
]
}
}