DLD.BZ URL Shortening

dld.bz is a private URL shortening service.

QR Codes

To generate a QR code for a short URL, simply append .qr to the short URL.

For example, to generate a QR code for http://dld.bz/BQT, change the URL to http://dld.bz/BQT.qr so when users click on http://dld.bz/BQT.qr they will get the QR code instead of being rerouted to the destination URL.

API Methods

The API is HTTP-based and is a RESTful resource. It is able to produce results in both XML and JSON formats.

API Method: Expand Short URL

URL: http://dld.bz/api/expand

Must be a GET call.

Parameters:

Example: curl http://dld.bz/api/expand?url=http%3A%2F%2Fdld.bz%2FasVhT&format=json

The expand method returns the following:

<?xml version="1.0" encoding="UTF-8"?>
<resultset xmlns="http://www.w3.org/TR/xptr-xmlns/">
  <data>
    <url>Contains the short URL</url>
    <long_url>Contains the expanded long URL</url>
  </data>
</resultset>

Errors

On calls that are understood by the API and where the request was not successful, the API returns an appropriate HTTP status code and a well-formatted XML or JSON error response in the following construct.

<?xml version="1.0" encoding="UTF-8"?>
<resultset xmlns="http://www.w3.org/TR/xptr-xmlns/">
  <error>
    <code>404</code>
    <message>URL not found.</message>
  </error>
</resultset>


The code in the code element is the same as the HTTP status codes. The codes, and their broad meaning are:



Copyright © 2010-2014, dld.bz. All Rights Reserved.