From 35f5677775c7ca961a7a24ff79b20c70b909914f Mon Sep 17 00:00:00 2001 From: Sebastian Preisner Date: Sat, 13 May 2017 08:26:58 +0000 Subject: [PATCH] Todo and API --- README.md | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 078f373..3b14b02 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # shrt - -Shrt is a url shortner writen in Go and by (Polr)[https://polr.me/index.php]. - +Shrt is a lightwaight, self-hostable open-source link shortening web application with a Restful API. It allows you to host your own URL shortener to gain control over you data. Shrt is inspired by [Polr](https://polr.me/index.php), a php based url shortener. ## Features @@ -14,7 +12,16 @@ Shrt is a url shortner writen in Go and by (Polr)[https://polr.me/index.php]. * [ ] Login -## Restful API +## API +To authenticate a user to Polr, you will need to provide an API key along with each request to the Polr API, as a GET or POST parameter. (e.g ``?key=API_KEY_HERE``) + + +### /api/v1/action/shorten + +Arguments: + +* ``url``: the URL to shorten (e.g https://google.com) +* ``custom_ending`` [not now supported] (optional): a custom ending for the short URL. If left empty, no custom ending will be assigned. Short an URL ``` @@ -25,6 +32,12 @@ Response: "result": "https://example.com/5kq" } ``` +### /api/v1/action/lookup + +Arguments: + +* ``url_ending``: the link ending for the URL to look up. (e.g 5ga) + Lookup for existing URL ``` @@ -38,4 +51,9 @@ Response: "clicks":"0" } } -``` \ No newline at end of file +``` + +## ToDo + +* [ ] Add more Statistik details like the clicks from Country and Referer. +* [ ] Implements the correct HTTP Error Codes