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
- GET /{hash} We send a hash of the shortUrl like #24azry which is unique to get the corresponding longUrl
- 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)
- DELETE /{hash} Send hash(#24azry) along with DELETE request to delete the shorten url
Leave your thoughts in the comments y’all. DB design is up next !
Top comments (0)