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 !

Image of Bright Data

High-Quality Data for AI – Access diverse datasets ready for your ML models.

Browse our extensive library of pre-collected datasets tailored for various AI and ML projects.

Explore Datasets

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more