Login| Register|
logo image  

All.to API Documentation

Getting Started

Sections
  • All.to API Documentation
    • Getting Started
    • Authentication and Shared Parameters
    • Request / Response Formats
    • REST Api

Authentication and Shared Parameters

All API endpoints require that authentication credentials be supplied as query arguments.

To get started, you'll need a free All.to user account and apiKey. Signup at: http://all.to/user/register.

If you already have an account, you can find your apikey at: http://all.to/shorten/manage/apikey

login=login&apikey=apikey


Request / Response Formats

All.to api has a param of format, but now only support txt.
format=txt
The HTTP Response Status Codes 200 and 500 was used.

The status_code is 200 for a successful request, and 500 for error.

When successful, server will return the short url. like this:
http://all.to/aBcD

When error, server will return a message begin with error:
error:some error message


REST API

/api/shorten/shorturl

For a long URL, /api/shorten/shorturl encodes a URL and returns a short one.

Parameters


urlthe long url that will be shorten,Required
prefixyou can use any prefix that we support, default is http://all.to/Optional
keycustomize short url keyOptional
key_passwordcustomize short url key passwordOptional
titlethe long url titleOptional
tagsthe tags of this url, split by commaOptional

Notes
  • Long URLs should be URL-encoded. You can not include a longUrl in the request that has '&', '?', '#', ' ', or other reserved parameters without first encoding it.
  • Long URLs should not contain spaces: any longUrl with spaces will be rejected. All spaces should be either percent encoded (%20) or plus encoded (+). Note that tabs, newlines and trailing spaces are all indications of errors. Please remember to strip leading and trailing whitespace from any user input before shortening.
  • use api, the shortened URL will be inserted into the history for the user specified by login.

sample:
http://all.to/api/shorten/shorturl?url=http%3A%2F%2Fbaike.baidu.com%2Fview%2F738301.htm%3Ffr%3Dala0_1_1&login=xxx&apikey=a_251ca78372fe0583b101c38fcfdd4e85
}