The Direct Print API
This is the Direct Print API which allows you to print HTML directly using your Little Printer. It offers an extremely simple way to render and print, however it is still very much in development, and so far is aimed at developers who want to prototype behaviour and functionality. This current implementation will be replaced by a more robust, permanent solution in the coming months, so please keep that in mind while creating services which depend on this.
To use the Direct Print API, take the unique code for your printer below, and add it to the end of this URL:
This forms the complete URL for your specific printer. To use the API, you make a POST request to this, with a single piece of form data, encoded with the name
htmland the corresponding value of whatever HTML you wish to print.
To test the API from the command line, you can type the following into a terminal:
$ curl -X POST --data-urlencode 'html=<html><head><meta charset="utf-8"></head><body><h1>Hello World!</h1><p>This is a paragraph tag.</p></body></html>' http://remote.bergcloud.com/playground/direct_print/YOURCODEHERE
Remember to keep your unique code secret! Knowledge of this code will allow anyone to print using your Little Printer. If you need to change your code, use the Regenerate button below.