Skip to content

abhaykumarvats/sankshipt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of Contents

Introduction

Sankshipt is a RESTful web API that provides functionality to shorten URLs, and visit the shortened ones.

Features

Documentation

Base URL: https://sankshipt.herokuapp.com

Shorten URL

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 Shortened URL

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'
    

Fun Fact

Sankshipt in Hindi means Abridged

Thanks

To Irene Ros for the doc template.

Signing-off, Abhay Kumar