- ip filtering
users : id_user|key|short_key
urls : id_url|key|id_user|protection|protection_argument|created|timeout|clicks
/shorten
{
"key": "api_key",
"url": "http://google.com"
}
optional:
-
long key :
"long_key": "1"
-
password protection :
"protection": "password",
"password": "custom_password" -
cookie protection (see /login):
"protection": "cookie",
"password": "custom_password"
results:
{
"shortUrl": "https://domain/0Ca$2C",
"longUrl": "http://google.com",
"status": "ok"
}
or
{
"shortUrl": "",
"longUrl": "http://longurl"
"status": "error"
"error": {
"code": 2,
"reason": "user_not_found",
"message": "User not found"
}
}
/expand
{
"key": "api_key",
"urls": "0Ca$2C,0Ca32C"
}
results:
{
"urls": [
{
"longUrl": "http://google.com",
"shortUrl": "https://domain/0Ca$2C"
}
],
"status": "ok"
}
or
{
"status": "error"
"error": {
"code": 2,
"reason": "user_not_found",
"message": "User not found"
}
}
/register
{
"password": "custom_password"
}
/list
{
"key": "api_key"
}
/get
{
"key": "api_key",
"urls": "key1,key2"
}
/delete
{
"key": "api_key",
"urls": "0Ca$2C,0CaSD2C"
}
or, to delete all links
{
"key": "api_key",
"urls": "-1"
}
/login
{
"key": "api_key"
}
/server/login
{
"password": "admin_password"
}
/user/new
{
"password": "admin_password"
}
/user/list
{
"password": "admin_password"
}
/user/get
{
"password": "admin_password"
"key": "user_key"
}
/user/delete
{
"password": "admin_password"
"key": "user_key"
}
/url/delete
{
"password": "admin_password"
"keys": "key1,key2,key3"
}