DEV Community

Cover image for TinyUrl— APIs
Avinash DV
Avinash DV

Posted on

TinyUrl— APIs

APIs:
4 Apis in total are needed at high level.

  • POST /shorten We send a long Url which is required and some optional params like alias, expire_at, user_id

Image description

  • GET /{hash} We send a hash of the shortUrl like #24azry which is unique to get the corresponding longUrl

Image description

  • GET /analytics/{hash} We send a hash(#24azry) of shourtUrl to get the analytics such as user_clicks, unique_clicks, location, site_referred(from which site it was accessed)

Image description

  • DELETE /{hash} Send hash(#24azry) along with DELETE request to delete the shorten url

Image description

Leave your thoughts in the comments y’all. DB design is up next !

Top comments (0)