Lessn More API

The Lessn More API is inherited from the original Lessn.

It's really simple. In fact, it's all just HTTP GET requests.

If you get a URL back, your request succeeded. If not, you're looking at an error message.

Authenticating

/-/?api=YOUR_API_KEY

Your API key is displayed when you log in to Lessn More.

Your API key must be used for every request.

Example usage: http://example.com/-/?url=http://google.com/&api=a8b45c20205f8bb34c

Get a short URL

Add a URL, or get the short URL for a URL already in the system - same call:

/-/?api=KEY&url=YOUR_URL

YOUR_URL must be escaped. In JavaScript, use encodeURIComponent().

Set a custom short URL

/-/?api=KEY&url=URL&custom_url=SLUG

Your slug should NOT start with a slash. Example slug: markdown.

Though it is not recommended, setting the GET variable overwrite will force the call to succeed, even if the slug already redirects somewhere else!

Remove a redirection

/-/?api=KEY&mark_gone&slug=SLUG

The redirection for the slug named SLUG will be marked as deleted. Requests for it will result in a 410 Gone error page.

(Not implemented yet, as of v. 2.0.; however the change could be made in the database.)

Redirect

redirect: allows you to create custom redirects. %l in the value of redirect is replaced with the Lessn'd url. Mostly useful for bookmarklets or other mashups.

Example usage, http://yourdomain.com/-/?url=<long url>&redirect=http%3A%2F%2Ftwitter.com%2F%3Fstatus%3D%l