Why?

Because I can.

How

The service allows you to create a new image, get an existing image, or view an existing image. The API is fairly simple. I don't have any security restrictions in place for retrieving the generated SVG so don't upload any sensitive drawings.

Props


Powered by fastly.

API

Creating an Image

To create a new image, simply PUT a request to http://api.a2saas.com/put.php. If you use CURL to do this, make sure to use the --data-binary flag to ensure your newlines are preserved.

On an error, you will receive a JSON object containing a property called error. The value of this property is the error message.

On success, you will receive a JSON object containing a property called success. The value of this property is the ID key for retrieving the image.

Retrieving an Image

To retrieve an image programmatically, simply run a GET request to http://api.a2saas.com/get.php?id=N, where N represents the ID returned from your call to create the image.

On an error, you will receive a JSON object containing a property called error. The value of this property is the error message.

On success, you will receive a JSON object containing a property called success. The value of this property is the SVG representing the uploaded data.

Viewing an Image

To view or embed an image, simply run a GET request to http://api.a2saas.com/view.php?id=N, where N represents the ID returned from your call to create the image.

In an error condition, you will receive some bold error text.

On success, the SVG is output with the proper content-type.