API

Tuzulo is written in terms of its own API, so this is not an afterthought.

Public URLs

A web site's API is really the set of URLs it takes. Here's ours:

http://www.tuzulo.com/codes/<hash>

Retrieve linkage codes for an upload.

http://www.tuzulo.com/codes/image/<hash>

Retrieve linkage codes for a single image.

http://www.tuzulo.com/codes/file/<hash>

Retrieve linkage codes for a single file.

http://www.tuzulo.com/<hash>

View upload together with the generated preview size. This is the Public Sharing Link.

http://www.tuzulo.com/image/<hash>

View image.

http://www.tuzulo.com/file/<file-hash>

View file.

Flash Remoting

http://www.tuzulo.com/api/images/<upload-hash>

Produces XML for Flash galleries of the form:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
 <image>
  <src>URL to high resolution image</src>
  <lowsrc>URL to low resolution thumbnail image</lowsrc>
  <tag>my great image</tag>
 </image>
 <image>
  <src>URL to high resolution image</src>
  <lowsrc>URL to low resolution thumbnail image</lowsrc>
 </image>
 .
 .
 .
</images>

To code up your own Flash gallery and use Tuzulo as the media server, you'll need to write an XML loader for ActionScript 2:

import XML2Object;

var xmlData:XML = new XML();
var content:Object;

xmlData.ignoreWhite = true;
xmlData.onLoad = function(loaded):void {
  if (loaded) {
    content = XML2Object.deserialize(this);
    /* normalization */
    if (content.images.image.length == undefined) {
      var tmp:Object = content.images.image;
      content.images.image = new Array();
      content.images.image[0] = tmp;
    }
  }
  // else nothing was loaded
}

Grab a copy of XML2Object.as and place inside the folder where your Flash .fla is located.

After loading, content.images.image is an array of objects. To get the 4th image in the list, using 0-based indexing, you would use something like:

content.images.image[3].src.data

which would access the src image. There is also, optionally, the lowsrc attribute and the tag attribute accessed with lowsrc.data and tag.data respectively.

Finally, you must call your XML loader with an appropriate Tuzulo URL, as above.

xmlData.load('http://www.tuzulo.com/api/images/<hash>');

ActionScript 3 can read the XML directly without XML2Object.

You cannot "invent" resolutions – you must use only those which have already been supplied. A Flash gallery is really a packaging exercise – the image data is loaded into the Flash gallery viewer/player at load time.

Tuzulo fully supports and embraces 3rd parties using our content delivery engine for making private Flash-based players. In fact, we'll even help you (within reason) write it. And no, you don't have to brand it to us.

AJAX API

http://www.tuzulo.com/api/codes/<upload-hash> (GET)

Retrieve JSON list of codes for the given upload.

http://www.tuzulo.com/api/upload/items/<upload-hash> (GET)

Get JSON list of uploaded items.

http://www.tuzulo.com/api/upload/order/<hash>?item=<hash>&item=<hash>&… (GET)

Resequence items (drag and drop). Ordering is canonical.