Sankshipt is a RESTful web API that provides functionality to shorten URLs, and visit the shortened ones.
Base URL: https://sankshipt.herokuapp.com
Provided URL is shortened to a unique number ID.
-
URL
/new
-
Method
GET
-
URL Params
Required:
/<original-url>
-
Success Response
-
Code: 200 OK
-
Content:
{ "_id":1, "original_url":"https://github.com/abhaykv04", "short_url":"https://sankshipt.herokuapp.com/1" }
-
-
Error Response
-
Code: 400 BAD REQUEST
-
Content:
400: Bad Request: Invalid URL
-
-
Sample Call
curl --request GET \ --url 'https://sankshipt.herokuapp.com/new/https://github.com/abhaykv04'
Visit an already shortened URL with its unique number ID.
-
URL
/
-
Method
GET
-
URL Params
Required:
<unique-id>
-
Success Response
-
Code: 200 OK
-
Content:
No content, you are redirected to original URL
-
-
Error Response
-
Code: 400 BAD REQUEST
-
Content:
400: Bad Request: ID must be a number
OR
-
Code: 404 NOT FOUND
-
Content:
404: ID Not Found
-
-
Sample Call
curl --request GET \ --url 'https://sankshipt.herokuapp.com/1'
Sankshipt
in Hindi
means Abridged