.تاکی , سرویس کوتاه کننده لینک با قابلیت ایجاد لینک کوتاه با رمز عبور و آدرس دلخواه, حذف لینک, ویرایش لینک, و مشاهده آمار دقیق کلیک
Tested on python 3.6 and 3.7
1 - clone the repo:
git clone https://github.com/erfanhs/tuky.git
2 - install virtual environment and project requirements:
pip3 install virtualenv
virtualenv venv
source venv/bin/activate
cd tuky
pip install -r requirements.txt
3 - configure settings.py (don't forget to config reCAPTCHA):
nano urlShortner/settings.py
4 - make migrations and migrate:
python3 manage.py makemigrations
python3 manage.py migrate
5 - run server:
python3 manage.py runserver
-
Authentication:
Security Scheme Type: Api Token
Header parameter name: Authorization
get api token:
1 - first login with your account: login
2 - get api token from your account settings page: settingsYou must send this header with all your requests:
{ "Authorization": "YOUR-API-TOKEN" }
-
Links:
Important: for POST & PUT methods, append slash to url is required. Otherwise, the GET request will be considered !
-
Create a short link:
method: POST
route: /api/v1/links/
required fields: long_url
optional fields: url_id, password, expiration_date
long_url: String (starts with http:// or https://)
url_id: String (max 65 char)
password: String
expiration_date: String (syntax: yy/mm/dd)
you must send these fields as form-data -
Get list of links
method: GET
route: /api/v1/links/
required fields: -
optional fields: search, limit, skip, all
search: String (a keyword to search in url id and long urls)
limit: String (numerical)
skip: String (numerical)
all: String ("false" or "0")
you must send these fields as GET Request parameters
example: http://tuky.ir/api/v1/links?limit=15&skip=20&all=false&search=instagram -
Delete all links
method: DELETE
route: /api/v1/links/ -
Get link details
method: GET
route: /api/v1/links/[url_id] -
delete a link
method: DELETE
route: /api/v1/links/[url_id]/ -
edit a link
method: PUT
route: /api/v1/links/[url_id]/
optional fields: url_id, expiration_date, long_url
long_url: String (starts with http:// or https://)
url_id: String (max 65 char)
expiration_date: String (syntax: yy/mm/dd)
you must send these fields as form-data -
get link stats
method: GET
route: /api/v1/links/[url_id]/stats
-