Let's Shorten That Url

© 2013 — 2017 Luc Didry — License: WTFPL — About — API — Signin — Browser extensions

Lstu API

POST /login
Parameters:
  • login mandatory
    Your login
  • password mandatory
    Your password
  • format optional
    If equal to "json", response will be in JSON format, HTML format otherwise
Response:
  • JSON: success
    {"msg":"You have been successfully logged in.","success":true}
  • JSON: failure
    {"msg":"Please, check your credentials: unable to authenticate.","success":false}
  • Response for HTML format
    You will be redirected to the Lstu classic interface where you will be able to shorten URLs
GET /logout

Should always be successful

Parameters:
  • format optional
    If equal to "json", response will be in JSON format, HTML format otherwise
Response:
  • JSON: success
    {"msg":"You have been successfully logged out.","success":true}
  • Response for HTML format
    You will be redirected to Lstu successfully logged out interface
POST /a

You must be logged in to use it.

Parameters:
  • lsturl mandatory
    URL to shorten
  • lsturl-custom optional
    Custom shortened text
  • format optional
    If equal to "json", response will be in JSON format, HTML format otherwise
Response:
  • JSON: success
    {"url":"https:\/\/fiat-tux.fr","short":"https:\/s.lstu.fr\/XzQBd6eFa","success":true}
  • JSON: failure
    {"msg":"Failure reason","success":false}
  • Response for HTML format
    You will be redirected to the Lstu classic interface with a message giving the shortened URL
GET /shortened_url
Response:
  • You will be redirected to the targeted URL or to the Lstu interface with a message giving the failure reason
GET /shortened_url.json
Response:
  • JSON: success
    {"url":"https:\/\/fiat-tux.fr","success":true}
  • JSON: failure
    {"msg":"Failure reason","success":false}
GET /stats

You must be logged in to use it.

It will use Lstu's cookies to know which shortened URL it will return statistics for.

Parameters:
  • format optional
    If equal to "json", response will be in JSON format, HTML format otherwise
Response:
    • Response for JSON format
      [{"short":"https:\/s.lstu.fr\/shortened_url","url":"URL","counter":integer, how many unique visits of the shortened URL}]
    • Response for HTML format
      A page with a table containing the same informations that the JSON response