xvr.in uses the Open URL Shortener. Open URL Shortener provides a fairly basic API (Application Programming Interface) which can be used in order for other applications to harness our URL shortening service. This works by accessing a particular URL on the Open URL Shortener site which accepts the long URL you would like shortened as a parameter. The shortened URL (or various error conditions as appropriate) will then be returned in the HTTP response.
Simply point to the custom API endpoint at http://xvr.in/?longurl=%@ and you're done. Technical details below.
Simply have your application access a URL similar to the following, via an HTTP GET request: http://xvr.in/?longurl=http://www.example.com
After submitting the URL you would like shortened as specified above, an HTTP response (web page) will be returned. The response header will be "HTTP/1.1 200 OK" if the URL was shortened as expected, or "HTTP/1.1 500 Internal Server Error" if there was any problem that prevented this.
Assuming the request was successful, the body of the response will contain only the new shortened URL, in plain text. If the request was unsuccessful, the body of the response will contain a specific error message giving the reason. These always begin with "Error: " followed by a message describing why the error occured. These should be fairly self explanatory and include things like the URL being on our blacklist or being too long (over 2000 characters).
Conditions on excessive usage still apply - the API is primarily intended for use in low volume applications and applications such as browser plugins, scripts etc. that run on the machine of an end user. As such if you're submitting extreme amounts of requests for any reason and hammering the server (e.g. if you have a bad script that submits the same URLs over and over again throughout the day) we may block your IP at our firewall without notice. The same applies if you're opening multiple concurrent connections. Please email via the contact section if you have any queries.