API Docs

Create URL

Create URL by sending POST data in json format to REST API endpoint: /api/v1/urls

Request

Parameter Type Position # Description
apikey string Header Required Enter your 20-characters unique api key.
apisecret string Header Required Enter your 12-characters unique api secter.
Content-Type string Header Required application/json
destination string Body Required The destination URL that you want to transform into short URL.
slashtag string Body Optional The keyword for your branded short URL. Max: 100 characters
redirect_code string Body Optional HTTP redirect codes (301, 302, 303, 304, 307, or 308). Default is 301
password string Body Optional Password to protect URL and default is no password. Max: 50 characters
domain_id integer Body Optional ID of branded short domain. Default is 0 (no branded domain)
tag_id integer Body Optional ID of tag. Default is 0 (no tag)
expires_after integer Body Optional
(Strongly Recommended)
Number of days (URL will expire after X number days from today). Default is 0 (URL will never expire). Max: 3650

Sample post-data json


{
    "destination":"https://t2mio.com/blog/google-url-shortener-goo-gl-shutting-down/",
    "slashtag":"googl_t2m",
    "redirectCode":301,
    "password":"abc456",
    "domain_id":123,
    "expires_after":90
}

Usage of "expires_after":
If you create your short URL at 2021-05-12 05:19:29 and set expires_after as 30 (means 30 days), then your short URL will expire at 2021-06-11 05:19:29

Response

{
    "status": 200,
    "message": "ok",
    "data": {
        "id": 114,
        "destination": "https://t2mio.com/blog/google-url-shortener-goo-gl-shutting-down/",
        "hits": 0,
        "redirectCode": 301,
        "shortUrl": "http://google.com/googl_t2m",
        "slashtag": "googl_t2m",
        "password": "Yes",
        "createdAt": "2018-06-16 06:49:52"
    }
}
											
{
    "status": 400,
    "message": "Bad request. <detailed-msg-will-go-here.>",
    "data": []
}