Yet another Django URL shortener API
- Uses the model id, and encode it to an arbitrary base 57(all numbers, lowercase and uppercase letter except for 0,O,1,I,l) as shorted url
- Swagger and reDoc Documentaion are available
GET /api/v1
{
"id": 1,
"detail_url": "http://domain/api/v1/1/",
"long_url": "https:google.com/some-extra-parameters",
"short_url": "http://domain/3/",
"view_count": 1
},
....
{
"id": 4,
"detail_url": "http://domain/api/v1/4/",
"long_url": "https://mail.google.com/mail/ca/u/0/#inbox",
"short_url": "http://domain/6/",
"view_count": 0
}
POST /api/v1
{"long_url" : "an url"}
response code 201 and returns URL instance and its details
GET /v1/{id}/
{"id" : "an integer, unique ID"}
{
"id": 4,
"detail_url": "http://domain/api/v1/4/",
"long_url": "https://mail.google.com/mail/ca/u/0/#inbox",
"short_url": "http://domain/6/",
"view_count": 0
}
DELETE /v1/{id}/
{"id" : "an integer, unique ID"}
response code 240, meaning instance has been deleted.
- Write test
- Auto custom short URL option
- compelete README.md